[DEV]Simple Attendance Mod(0.0.1)

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment!
Scam Warning
Locked
wired076
Registered User
Posts: 1441
Joined: Mon May 21, 2007 10:19 am

[DEV]Simple Attendance Mod(0.0.1)

Post by wired076 »

This is a fork of development from the Attendance Mod located here - http://www.phpbb.com/community/viewtopi ... &start=120 as requested by Volksdevil.

At this stage this is where the functionality/features will be discussed for the new mod.

Once a beta is created the mod will be released here.
Last edited by wired076 on Mon Dec 06, 2010 9:59 pm, edited 2 times in total.
User avatar
Volksdevil
Registered User
Posts: 2415
Joined: Sun Oct 03, 2010 2:03 pm
Location: Lancashire, UK
Name: Neil
Contact:

Re: (0.0.1)Simple Attendance Mod

Post by Volksdevil »

Hi wired076 :D

Some basic info:
1/ Members should always be able to 'unregister' from an 'rsvp'
2/ I will add more here.


Although i suppose this means there would be no editable form to add options such as 'slots' for rolling road days? But maybe it's not needed, maybe it could just send the preset information via hidden form?

I will try and create some screen shots to help as much as i can.
Last edited by Volksdevil on Mon Aug 01, 2011 1:57 pm, edited 1 time in total.
My phpBB Extensions
Finally found great Website Hosting from Image KUALO!
Do NOT use 123-reg.co.uk - Incapable of running phpBB!
:ugeek: TekNeil - Streamer on Mixer | My Volkswagen Corrado G60
wired076
Registered User
Posts: 1441
Joined: Mon May 21, 2007 10:19 am

Re: (0.0.1)Simple Attendance Mod

Post by wired076 »

Volksdevil wrote:Hi wired076 :D

I guess my first question would be, can the submit method be changed from using the form next to the poll option to something like this? Makes it more visible being up top and within the actual topic creation area. 8-)
Although i suppose this means there would be no editable form to add options such as 'slots' for rolling road days? But maybe it's not needed, maybe it could just send the preset information via hidden form?

I will try and create some screen shots to help as much as i can.
Ok Volksdevil before I can make any design and/or coding modifications or decisions for this version we need to nut out all required changes.

Firstly I will start off with the below list. Please make adjustments as necessary:
  • In regards to this tick box to allow the RSVP option to allow this in a particular thread would these first have to be enabled for this particular board first in the ACP like the AM mod is currently?
  • In regards to presets currently colours, slots, name, number of options, layout, time to run registration, allow registration change, confirmation, activate registration are all possible to be defined either via the ACP or the AM tab in selected forums. Would we need to change this slightly so that the number of slots are defined per event and not per preset?
  • Would there be a need for any users to be able to override the settings in a preset when posting an event? ie the ability to set permissions on the options defined under a preset to only be shown to users with access or are we going to remove this functionality completely?
  • Any other required features not yet implemented?
That's all I can think of for now for modifications from the AM mod.
wired076
Registered User
Posts: 1441
Joined: Mon May 21, 2007 10:19 am

Re: (0.0.1)Simple Attendance Mod

Post by wired076 »

Volksdevil wrote:Edit: Ok, maybe this? would work? Notice the new bit underlined in BLUE. It says "Slots available, leave blank for unlimited"
By implementing the mod in this fashion you are limiting yourself to only one preset unless we were to have different presets to be associated with particular forums?

My thoughts would be to have the tick box there to allow RSVP and then to display a tab next to the poll like we have currently but have it streamlined to only include the bare essentials we require ie preset selection and number of slots to be defined at this stage. In this way it will keep the style looking sleek and not break the layout.

I think that once you start adding those additional options like in your screenshot it looks clunky but if we were to use a tab it will be easier for users to find and will potentially allow additional functionality to be added to this tab down the track if needed.
User avatar
Volksdevil
Registered User
Posts: 2415
Joined: Sun Oct 03, 2010 2:03 pm
Location: Lancashire, UK
Name: Neil
Contact:

Re: (0.0.1)Simple Attendance Mod

Post by Volksdevil »

I'm not sure. My users very rarely tend to use polls in all honesty. I think it would be fine as it's only going to be used in a few forums? I think the limitation/simplicity is what will be great about this mod :D What do you think?
wired076 wrote:Ok Volksdevil before I can make any design and/or coding modifications or decisions for this version we need to nut out all required changes.

Firstly I will start off with the below list. Please make adjustments as necessary:
  • In regards to this tick box to allow the RSVP option to allow this in a particular thread would these first have to be enabled for this particular board first in the ACP like the AM mod is currently?
Yes. Perfect. :D Unless there is an easier way for you? Using an <IF viewing forum id = x> statement maybe? I'm not sure that would work or be a good way to do it. Otherwise, your idea would be fine.
  • In regards to presets currently colours, slots, name, number of options, layout, time to run registration, allow registration change, confirmation, activate registration are all possible to be defined either via the ACP or the AM tab in selected forums. Would we need to change this slightly so that the number of slots are defined per event and not per preset?
Yes. Number of slots per event with the default being zero unless another number is input. The colours aren't needed (Simple form buttons instead?)
The layout should not be editable, and should stay as 'rows'.
Time to run...Maybe that could also be added alongside the blue in my above picture? or left out? Either way is fine.
No need for confirmation, simply 'RSVP' to this event with button.
No need for activate registration either :D

  • Would there be a need for any users to be able to override the settings in a preset when posting an event? ie the ability to set permissions on the options defined under a preset to only be shown to users with access or are we going to remove this functionality completely?
  • Any other required features not yet implemented?
No need to overide any setting. I think if the permissions from the forum the event is posted in are used, that should be fine.

That's all I can think of for now for modifications from the AM mod.
I hope I am being a help rather than a hinderence wired076 :oops:
Last edited by Volksdevil on Mon Aug 01, 2011 1:57 pm, edited 1 time in total.
My phpBB Extensions
Finally found great Website Hosting from Image KUALO!
Do NOT use 123-reg.co.uk - Incapable of running phpBB!
:ugeek: TekNeil - Streamer on Mixer | My Volkswagen Corrado G60
User avatar
imkingdavid
Former Team Member
Posts: 2673
Joined: Sun Jul 26, 2009 7:59 pm
Location: EST
Name: David King

Re: (0.0.1)Simple Attendance Mod

Post by imkingdavid »

Hi,
Please prefix your topic title with one of the prefixes explained here.
Thanks,
David
Don't forget to smile today. :)
Please do NOT contact for support via PM or email.
wired076
Registered User
Posts: 1441
Joined: Mon May 21, 2007 10:19 am

Re: (0.0.1)Simple Attendance Mod

Post by wired076 »

imkingdavid wrote:Hi,
Please prefix your topic title with one of the prefixes explained here.
Thanks,
David
Updated.

Thanks for the reminder David! :)
User avatar
Volksdevil
Registered User
Posts: 2415
Joined: Sun Oct 03, 2010 2:03 pm
Location: Lancashire, UK
Name: Neil
Contact:

Re: [DEV]Simple Attendance Mod(0.0.1)

Post by Volksdevil »

How is it going wired076? 8-)

Hopefully I haven't caused you too much work!
My phpBB Extensions
Finally found great Website Hosting from Image KUALO!
Do NOT use 123-reg.co.uk - Incapable of running phpBB!
:ugeek: TekNeil - Streamer on Mixer | My Volkswagen Corrado G60
wired076
Registered User
Posts: 1441
Joined: Mon May 21, 2007 10:19 am

Re: [DEV]Simple Attendance Mod(0.0.1)

Post by wired076 »

Volksdevil wrote:How is it going wired076? 8-)

Hopefully I haven't caused you too much work!
Hi Volksdevil I am well but it has come to my concern that there has been a bug identified in the AM mod. I also have a lot of work on my plate at the moment so it will take me a bit of time to get onto this but once I have something I will let you know.

Please note that I will not post anything until I have made a few of the modifications and tested them.
wired076
Registered User
Posts: 1441
Joined: Mon May 21, 2007 10:19 am

Re: (0.0.1)Simple Attendance Mod

Post by wired076 »

Volksdevil wrote:I'm not sure. My users very rarely tend to use polls in all honesty. I think it would be fine as it's only going to be used in a few forums? I think the limitation/simplicity is what will be great about this mod :D What do you think?
wired076 wrote:Ok Volksdevil before I can make any design and/or coding modifications or decisions for this version we need to nut out all required changes.

Firstly I will start off with the below list. Please make adjustments as necessary:
  • In regards to this tick box to allow the RSVP option to allow this in a particular thread would these first have to be enabled for this particular board first in the ACP like the AM mod is currently?
Yes. Perfect. :D Unless there is an easier way for you? Using an <IF viewing forum id = x> statement maybe? I'm not sure that would work or be a good way to do it. Otherwise, your idea would be fine.
  • In regards to presets currently colours, slots, name, number of options, layout, time to run registration, allow registration change, confirmation, activate registration are all possible to be defined either via the ACP or the AM tab in selected forums. Would we need to change this slightly so that the number of slots are defined per event and not per preset?
Yes. Number of slots per event with the default being zero unless another number is input. The colours aren't needed (Simple form buttons instead?)
The layout should not be editable, and should stay as 'rows'.
Time to run...Maybe that could also be added alongside the blue in my above picture? or left out? Either way is fine.
No need for confirmation, simply 'RSVP' to this event with button.
No need for activate registration either :D

  • Would there be a need for any users to be able to override the settings in a preset when posting an event? ie the ability to set permissions on the options defined under a preset to only be shown to users with access or are we going to remove this functionality completely?
  • Any other required features not yet implemented?
No need to overide any setting. I think if the permissions from the forum the event is posted in are used, that should be fine.

That's all I can think of for now for modifications from the AM mod.
I hope I am being a help rather than a hinderence wired076 :oops:
Here is another screen shot once a topic/event is posted.
I agree that simplicity should be key however at this stage the Attendance Mod is unable to be adapted in this way very easily by removing these parts of the code to create a simple version.

I will have a look at possibly trying to restrict access by if statements and see if this is more achieve able.

As such I will need a few days to plan out which method is best for me to proceed with the mod.

However at this stage the main priority is to get the AM mod submitted and validated by the mod database as this will help in getting closer to achieving the goals of getting a simple version created as a separate entity or as an option in the AM mod.

I guess what I am trying to say is at the moment the timing for implementing this version/feature is not the best timed for me or in the development of the mod but I will have a think about where to go from here.
User avatar
Volksdevil
Registered User
Posts: 2415
Joined: Sun Oct 03, 2010 2:03 pm
Location: Lancashire, UK
Name: Neil
Contact:

Re: [DEV]Simple Attendance Mod(0.0.1)

Post by Volksdevil »

8-)
My phpBB Extensions
Finally found great Website Hosting from Image KUALO!
Do NOT use 123-reg.co.uk - Incapable of running phpBB!
:ugeek: TekNeil - Streamer on Mixer | My Volkswagen Corrado G60
User avatar
Volksdevil
Registered User
Posts: 2415
Joined: Sun Oct 03, 2010 2:03 pm
Location: Lancashire, UK
Name: Neil
Contact:

Re: [DEV]Simple Attendance Mod(0.0.1)

Post by Volksdevil »

How are things wired076 ? :D
My phpBB Extensions
Finally found great Website Hosting from Image KUALO!
Do NOT use 123-reg.co.uk - Incapable of running phpBB!
:ugeek: TekNeil - Streamer on Mixer | My Volkswagen Corrado G60
wired076
Registered User
Posts: 1441
Joined: Mon May 21, 2007 10:19 am

Re: [DEV]Simple Attendance Mod(0.0.1)

Post by wired076 »

Volksdevil wrote:How are things wired076 ? :D
Things are good however I am not yet able to continue working on this as yet.

I have however just submitted a new version of the mod for validation.

In the meantime if you wish to modify your board to suit your need's with the AM tab you may remove the following from posting_am_body.html in your styles template folder:

Code: Select all

	<!-- IF S_AM_PRESET -->
	<dl style="display:none;">
		<dt style="display:none;"><label for="am_preset_save">{L_AM_PRESET_SAVE}:</label><br /><span> {L_AM_PRESET_SAVE_EXPLAIN}</span></dt>
		<dd style="display:none;"><label for="am_preset_save"><input type="checkbox" id="am_preset_save" name="am_preset_save" onClick="show_preset_name();" /><div id="am_preset_div" style="visibility:hidden"> {L_AM_PRESET_NAME}: <input type="text" name="am_preset_name" id="am_preset_name" size="31" maxlength="50" value="" class="inputbox autowidth" /></div></label></dd>
	</dl>
	<!-- ENDIF -->
and

Code: Select all

	<!-- IF S_AM_DELETE -->
	<dl>
		<dt><label for="am_reset">{L_AM_RESET}:</label></dt>
		<dd><label for="am_reset"><input type="checkbox" name="am_reset" id="am_reset"<!-- IF S_AM_RESET_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_AM_RESET_EXPLAIN}</label></dd>
	</dl>
	<dl>
		<dt><label for="am_delete">{L_AM_DELETE}:</label></dt>
		<dd><label for="am_delete"><input type="checkbox" name="am_delete" id="am_delete"<!-- IF S_AM_DELETE_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_AM_DELETE_EXPLAIN}</label></dd>
	</dl>
	<!-- ENDIF -->
Then for each other element you will need to use

Code: Select all

style="display:none;"
to hide these element's from the user. Please note that these will still load when the page is called but they will not be shown.

I have modified a copy of this page already for you for ProSilver. This is included below:

Code: Select all

<script type="text/javascript">
<!--

// tabledeleterow.js version 1.2 2006-02-21
// mredkj.com

var OPTION_TEXT = 'am_option_text[]';
var OPTION_MAX = 'am_option_max[]';
var OPTION_COLOR = 'am_option_color[]';
var OPTION_COLORWATCH = 'am_option_colorwatch[]';
var OPTION_COLORPICK = 'am_option_colorpick[]';
var OPTION_ID = 'am_option_id[]';
var TABLE_NAME = 'am_options_table';
var ROW_BASE = 1;
var hasLoaded = false;
var optioncount = 0;
preset_options = new Array();
window.onload=fillInRows;

{AM_OPTIONS_JSCODE}

function fillInRows()
{
	hasLoaded = true;

	var am_options_array = new Array({AM_OPTIONS});
	var am_options_max_array = new Array({AM_OPTIONS_MAX});
	var am_options_color_array = new Array({AM_OPTIONS_COLOR});
	var am_options_id_array = new Array({AM_OPTIONS_ID});
	var num = null;

	if (am_options_array.length > 0)
	{
		for (var i = 0; i < am_options_array.length; i++)
		{
			var actual_option = am_options_array[i];
			var actual_option_max = am_options_max_array[i];
			var actual_option_color = am_options_color_array[i];
			var actual_option_id = am_options_id_array[i];
			addRowToTable(num, actual_option, actual_option_max, actual_option_color, actual_option_id);
		}
	}
	else
	{
		var actual_option = null;
		var actual_option_max = null;
		var actual_option_color = null;
		var actual_option_id = null;
		addRowToTable(num, actual_option, actual_option_max, actual_option_color, actual_option_id);
		addRowToTable(num, actual_option, actual_option_max, actual_option_color, actual_option_id);
	}
}

function myRowObject(one, two, three, four, five, six, seven, eight, nine, ten)
{
	this.one = one;
	this.two = two;
	this.three = three;
	this.four = four;
	this.five = five;
	this.six = six;
	this.seven = seven;
	this.eight = eight;
	this.nine = nine;
	this.nine = ten;
}

function addRowToTable(num, actual_option, actual_option_max, actual_option_color, actual_option_id)
{
	if (hasLoaded)
	{
		var tbl = document.getElementById(TABLE_NAME);
		var nextRow = tbl.tBodies[0].rows.length;
		var iteration = nextRow + ROW_BASE;
		if (num == null)
		{
			num = nextRow;
		}
		else
		{
			iteration = num + ROW_BASE;
		}

		if (actual_option == null)
		{
			var actual_option = '';
		}

		if (actual_option_max == null)
		{
			var actual_option_max = '';
		}

		if (actual_option_color == null)
		{
			var actual_option_color = '';
		}

		if (actual_option_id == null)
		{
			var actual_option_id = '';
		}

		var row = tbl.tBodies[0].insertRow(num);

		var cell0 = row.insertCell(0);
		var textNode1 = document.createTextNode('{L_AM_OPTION} '+iteration);
		cell0.appendChild(textNode1);

		var cell1 = row.insertCell(1);
		var txtInp1 = document.createElement('input');
		txtInp1.className = 'inputbox autowidth';
		txtInp1.setAttribute('value', actual_option);
		txtInp1.setAttribute('maxlength', '150');
		txtInp1.setAttribute('size', '40');
		txtInp1.setAttribute('name', OPTION_TEXT);
		txtInp1.setAttribute('type', 'text')
		cell1.appendChild(txtInp1);

		var cell2 = row.insertCell(2);
		var textNode2 = document.createTextNode('{L_AM_OPTION_MAX}');
		cell2.appendChild(textNode2);

		var cell3 = row.insertCell(3);
		var txtInp2 = document.createElement('input');
		txtInp2.className = 'inputbox autowidth';
		txtInp2.setAttribute('value', actual_option_max);
		txtInp2.setAttribute('maxlength', '4');
		txtInp2.setAttribute('size', '5');
		txtInp2.setAttribute('name', OPTION_MAX);
		txtInp2.setAttribute('type', 'text');
		cell3.appendChild(txtInp2);

		var cell4 = row.insertCell(4);
		var textNode3 = document.createTextNode('{L_AM_OPTION_COLOR}');
		cell4.appendChild(textNode3);

		var cell5 = row.insertCell(5);
		var txtInp3 = document.createElement('input');
		if (actual_option_color == '')
		{
			getDefaultColor(iteration);
			txtInp3.setAttribute('value', ''+defaultColor);
		}
		else
		{
			txtInp3.setAttribute('value', actual_option_color);
		}
		txtInp3.className = 'inputbox autowidth';
		txtInp3.setAttribute('maxlength', '7');
		txtInp3.setAttribute('size', '8');
		txtInp3.onchange = function () {changeColor(this.value, txtInp4)};
		txtInp3.setAttribute('id', OPTION_COLOR);
		txtInp3.setAttribute('name', OPTION_COLOR);
		txtInp3.setAttribute('type', 'text');
		cell5.appendChild(txtInp3);

		var cell6 = row.insertCell(6);
		getDefaultColor(iteration);
		var txtInp4 = document.createElement('input');
		if (actual_option_color == '')
		{
			getDefaultColor(iteration);
			txtInp4.style.backgroundColor = ''+defaultColor;
		}
		else
		{
			txtInp4.style.backgroundColor = ''+actual_option_color;
		}
		txtInp4.setAttribute('readOnly', 'true');
		txtInp4.className = 'inputbox autowidth';
		txtInp4.setAttribute('maxlength', '0');
		txtInp4.setAttribute('size', '1');
		txtInp4.setAttribute('id', OPTION_COLORWATCH);
		txtInp4.setAttribute('name', OPTION_COLORWATCH);
		txtInp4.setAttribute('type', 'text');
		cell6.appendChild(txtInp4);

		var cell7 = row.insertCell(7);
		var btnEl1 = document.createElement('input');
		btnEl1.className = 'button2';
		btnEl1.setAttribute('value', '{L_AM_OPTION_PICK_COLOR}');
		btnEl1.onclick = function () {showColorPicker(this,txtInp3,txtInp4)};
		btnEl1.setAttribute('id', OPTION_COLORPICK);
		btnEl1.setAttribute('name', OPTION_COLORPICK);
		btnEl1.setAttribute('type', 'button');
		cell7.appendChild(btnEl1);

		var cell8 = row.insertCell(8);
		var btnEl2 = document.createElement('input');
		btnEl2.className = 'button2';
		btnEl2.setAttribute('value', '{L_AM_REMOVE_OPTION}');
		btnEl2.onclick = function () {deleteCurrentRow(this)};
		btnEl2.setAttribute('type', 'button');
		cell8.appendChild(btnEl2);

		var cell9 = row.insertCell(9);
		var txtInp5 = document.createElement('input');
		txtInp5.className = 'inputbox autowidth';
		txtInp5.setAttribute('value', actual_option_id);
		txtInp5.setAttribute('maxlength', '150');
		txtInp5.setAttribute('size', '10');
		txtInp5.setAttribute('name', OPTION_ID);
		txtInp5.setAttribute('type', 'hidden')
		cell9.appendChild(txtInp5);

		row.myRow = new myRowObject(textNode1, txtInp1, textNode2, txtInp2, textNode3, txtInp3, txtInp4, btnEl1, btnEl2, txtInp5);
	}
}

function deleteCurrentRow(obj)
{
	if (hasLoaded)
	{
		var delRow = obj.parentNode.parentNode;
		var tbl = delRow.parentNode.parentNode;
		var rIndex = delRow.sectionRowIndex;
		var rowArray = new Array(delRow);
		deleteRows(rowArray);
		reorderRows(tbl, rIndex);
	}
}

function reorderRows(tbl, startingIndex)
{
	if (hasLoaded)
	{
		if (tbl.tBodies[0].rows[startingIndex])
		{
			var count = startingIndex + ROW_BASE;
			for (var i=startingIndex; i<tbl.tBodies[0].rows.length; i++)
			{
				tbl.tBodies[0].rows[i].myRow.one.data = '{L_AM_OPTION}' + ' ' + count;

				tbl.tBodies[0].rows[i].myRow.two.name = OPTION_TEXT;

				tbl.tBodies[0].rows[i].myRow.three.data = '{L_AM_OPTION_MAX}';

				tbl.tBodies[0].rows[i].myRow.four.name = OPTION_MAX;

				tbl.tBodies[0].rows[i].myRow.five.data = '{L_AM_OPTION_COLOR}';

				tbl.tBodies[0].rows[i].myRow.six.name = OPTION_COLOR;
				tbl.tBodies[0].rows[i].myRow.six.id = OPTION_COLOR;

				tbl.tBodies[0].rows[i].myRow.seven.name = OPTION_COLORWATCH;
				tbl.tBodies[0].rows[i].myRow.seven.id = OPTION_COLORWATCH;

				tbl.tBodies[0].rows[i].myRow.ten.name = OPTION_ID;
				tbl.tBodies[0].rows[i].myRow.ten.id = OPTION_ID;

				count++;
			}
		}
	}
}

function deleteRows(rowObjArray)
{
	if (hasLoaded)
	{
		for (var i=0; i<rowObjArray.length; i++)
		{
			var rIndex = rowObjArray[i].sectionRowIndex;
			rowObjArray[i].parentNode.deleteRow(rIndex);
		}
	}
}

function preset()
{
	var preset_index = document.getElementById("am_preset").value; 
	insertPresetData(preset_index);
}

function deleteAllRows()
{
	if (hasLoaded)
	{
		var tbl = document.getElementById(TABLE_NAME);
		for (var i=tbl.tBodies[0].rows.length-1; i>=0; i--)
		{
	    	tbl.tBodies[0].deleteRow(i);
		}
	}
}

function construct_options(option_text, option_max, option_color)
{
	preset_options[optioncount] = new Array();
	preset_options[optioncount][0] = option_text;
	preset_options[optioncount][1] = option_max;
	preset_options[optioncount][2] = option_color;
	optioncount++;
}

function insertPresetData(selectObj)
{
	var am_length_ary = ""+"{AM_LENGTH_ARRAY}";
	var am_length_ary = am_length_ary.split(",");
	var am_visible_ary = ""+"{AM_VISIBLE_ARRAY}";
	var am_visible_ary = am_visible_ary.split(",");	
	var am_confirmable_ary = ""+"{AM_CONFIRMABLE_ARRAY}";
	var am_confirmable_ary = am_confirmable_ary.split(",");
	var am_reg_change_ary = ""+"{AM_REG_CHANGE_ARRAY}";
	var am_reg_change_ary = am_reg_change_ary.split(",");
	var am_layout_ary = ""+"{AM_LAYOUT_ARRAY}";
	var am_layout_ary = am_layout_ary.split(",");

	if (selectObj != "")
	{
		deleteAllRows();
		
		var obj_am_length = document.getElementById("am_length");
		var obj_am_visible = document.getElementById("am_visible");
		var obj_am_confirmable = document.getElementById("am_confirmable");
		var obj_am_reg_change = document.getElementById("am_reg_change");		
		var obj_am_layout = document.getElementById("am_layout");
		
		for (var i = 0; i < am_length_ary.length; i++)
		{
			if ( i == selectObj )
			{
				obj_am_length.value = am_length_ary[i];				
				obj_am_visible.checked = (am_visible_ary[i] == 1 ? true : false);
				obj_am_confirmable.checked = (am_confirmable_ary[i] == 1 ? true : false);				
				obj_am_reg_change.checked = (am_reg_change_ary[i] == 1 ? true : false);
				obj_am_layout.selectedIndex = am_layout_ary[i];
				
				var actual_option_text = preset_options[i][0];
				var actual_option_text_ary = actual_option_text.split("\n");
				var actual_option_max = preset_options[i][1];
				var actual_option_max_ary = actual_option_max.split("\n");
				var actual_option_color = preset_options[i][2];
				var actual_option_color_ary = actual_option_color.split("\n");					
																			
				for (j = 0; j < actual_option_text_ary.length; j++)
				{			
					var actual_option_id = null;
					var num = null;				
														
					addRowToTable(num, actual_option_text_ary[j], actual_option_max_ary[j], actual_option_color_ary[j], actual_option_id);
				}
			}
		}
	}	
}

function show_preset_name()
{
   if (document.getElementById('am_preset_save').checked==true)
   document.getElementById('am_preset_div').style.visibility='visible';
   else document.getElementById('am_preset_div').style.visibility='hidden';
}

function getDefaultColor(rowcount)
{
	var colorArray = new Array("#000000", "#800000", "#008000", "#808000", "#000080", "#800080", "#008080", "#C0C0C0", "#808080", "#FF0000", "#00FF00", "#FFFF00", "#0000FF", "#FF00FF", "#00FFFF", "#FFFFFF");
	rowcount = rowcount - 1;
	if ( rowcount > 15 )
	{
		rowcount = rowcount % 16;
		defaultColor = colorArray[rowcount];
	}
	else
	{
		defaultColor = colorArray[rowcount];
	}
	return defaultColor;
}

function changeColor(color, txtInp4)
{
	txtInp4.style.backgroundColor = ''+color;
}

/************************************************************************************************************
(C) www.dhtmlgoodies.com, October 2005
************************************************************************************************************/

var MSIE = navigator.userAgent.indexOf('MSIE')>=0?true:false;
var navigatorVersion = navigator.appVersion.replace(/.*?MSIE (\d\.\d).*/g,'$1')/1;

var handle_start_x;
var event_start_x;
var currentSliderIndex;

function form_widget_cancel_event()
{
	return false;
}

 var namedColorRGB = new Array('#F0F8FF','#FAEBD7','#00FFFF','#7FFFD4','#F0FFFF','#F5F5DC','#FFE4C4','#000000','#FFEBCD','#0000FF','#8A2BE2','#A52A2A','#DEB887',
'#5F9EA0','#7FFF00','#D2691E','#FF7F50','#6495ED','#FFF8DC','#DC143C','#00FFFF','#00008B','#008B8B','#B8860B','#A9A9A9','#006400','#BDB76B','#8B008B',
'#556B2F','#FF8C00','#9932CC','#8B0000','#E9967A','#8FBC8F','#483D8B','#2F4F4F','#00CED1','#9400D3','#FF1493','#00BFFF','#696969','#1E90FF','#D19275',
'#B22222','#FFFAF0','#228B22','#FF00FF','#DCDCDC','#F8F8FF','#FFD700','#DAA520','#808080','#008000','#ADFF2F','#F0FFF0','#FF69B4','#CD5C5C','#4B0082',
'#FFFFF0','#F0E68C','#E6E6FA','#FFF0F5','#7CFC00','#FFFACD','#ADD8E6','#F08080','#E0FFFF','#FAFAD2','#D3D3D3','#90EE90','#FFB6C1','#FFA07A','#20B2AA',
'#87CEFA','#8470FF','#778899','#B0C4DE','#FFFFE0','#00FF00','#32CD32','#FAF0E6','#FF00FF','#800000','#66CDAA','#0000CD','#BA55D3','#9370D8','#3CB371',
'#7B68EE','#00FA9A','#48D1CC','#C71585','#191970','#F5FFFA','#FFE4E1','#FFE4B5','#FFDEAD','#000080','#FDF5E6','#808000','#6B8E23','#FFA500','#FF4500',
'#DA70D6','#EEE8AA','#98FB98','#AFEEEE','#D87093','#FFEFD5','#FFDAB9','#CD853F','#FFC0CB','#DDA0DD','#B0E0E6','#800080','#FF0000','#BC8F8F','#4169E1',
'#8B4513','#FA8072','#F4A460','#2E8B57','#FFF5EE','#A0522D','#C0C0C0','#87CEEB','#6A5ACD','#708090','#FFFAFA','#00FF7F','#4682B4','#D2B48C','#008080',
'#D8BFD8','#FF6347','#40E0D0','#EE82EE','#D02090','#F5DEB3','#FFFFFF','#F5F5F5','#FFFF00','#9ACD32');


var color_picker_div = false;
var color_picker_active_tab = false;
var color_picker_form_field = false;
var color_picker_colorform_field = false;
var color_picker_active_input = false;

function baseConverter (number,ob,nb)
{
	number = number + "";
	number = number.toUpperCase();
	var list = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
	var dec = 0;
	for (var i = 0; i <=  number.length; i++)
	{
		dec += (list.indexOf(number.charAt(i))) * (Math.pow(ob , (number.length - i - 1)));
	}
	number = "";
	var magnitude = Math.floor((Math.log(dec))/(Math.log(nb)));
	for (var i = magnitude; i >= 0; i--)
	{
		var amount = Math.floor(dec/Math.pow(nb,i));
		number = number + list.charAt(amount);
		dec -= amount*(Math.pow(nb,i));
	}
	if(number.length==0)number=0;
	return number;
}

function colorPickerGetTopPos(inputObj)
{
	var returnValue = inputObj.offsetTop;
	while((inputObj = inputObj.offsetParent) != null)
	{
		returnValue += inputObj.offsetTop;
	}
	return returnValue;
}

function colorPickerGetLeftPos(inputObj)
{
	var returnValue = inputObj.offsetLeft;
	while((inputObj = inputObj.offsetParent) != null)returnValue += inputObj.offsetLeft;
	return returnValue;
}

function cancelColorPickerEvent()
{
	return false;
}

function showHideColorOptions(e,inputObj)
{
	var thisObj = this;
	if(inputObj)
	{
		var parentNode = inputObj.parentNode;
		thisObj = inputObj;
	}
	else var parentNode = this.parentNode;
	var activeColorDiv = false;
	var subDiv = parentNode.getElementsByTagName('DIV')[0];
	counter=0;
	var initZIndex = 10;
	var contentDiv = document.getElementById('color_picker_content').getElementsByTagName('DIV')[0];
	do
	{
		if(subDiv.tagName=='DIV' && subDiv.className!='colorPickerCloseButton')
		{
			if(subDiv==thisObj)
			{
				thisObj.className='colorPickerTab_active';
				thisObj.style.zIndex = 50;
				var img = thisObj.getElementsByTagName('IMG')[0];
				img.src = "{T_THEME_PATH}/images/tab_right_active.gif"
				img.src = img.src.replace(/inactive/,'active');
				contentDiv.style.display='block';
				activeColorDiv = contentDiv;
			}
			else
			{
				subDiv.className = 'colorPickerTab_inactive';
				var img = subDiv.getElementsByTagName('IMG')[0];
				img.src = "{T_THEME_PATH}/images/tab_right_inactive.gif";
				if(activeColorDiv)
					subDiv.style.zIndex = initZIndex - counter;
				else
					subDiv.style.zIndex = counter;
				contentDiv.style.display='none';
			}
			counter++;
		}
		subDiv = subDiv.nextSibling;
		if(contentDiv.nextSibling)contentDiv = contentDiv.nextSibling;
	}
	while(subDiv);
	document.getElementById('colorPicker_statusBarTxt').innerHTML = '&nbsp;';
}

function createColorPickerTopRow(inputObj)
{
	var tabs = [''];
	var tabWidths = [];
	var div = document.createElement('DIV');
	div.className='colorPicker_topRow';

	var innerSpan = document.createElement('SPAN');
	innerSpan.id = 'colorPicker_statusBarTxt';
	div.appendChild(innerSpan);

	inputObj.appendChild(div);
	var currentWidth = 0;
	var closeButton = document.createElement('DIV');
	closeButton.className='colorPickerCloseButton';
	closeButton.innerHTML = 'x';
	closeButton.onclick = closeColorPicker;
	closeButton.onmouseover = toggleCloseButton;
	closeButton.onmouseout = toggleOffCloseButton;
	div.appendChild(closeButton);
}

function toggleCloseButton()
{
	this.style.color='#FFF';
	this.style.backgroundColor = '#317082';
}

function toggleOffCloseButton()
{
	this.style.color='';
	this.style.backgroundColor = '';
}

function closeColorPicker()
{
	color_picker_div.style.display='none';
}

function createWebColors(inputObj)
{
	var webColorDiv = document.createElement('DIV');
	webColorDiv.style.paddingTop = '1px';
	inputObj.appendChild(webColorDiv);
	for(var r=15;r>=0;r-=3)
	{
		for(var g=0;g<=15;g+=3)
		{
			for(var b=0;b<=15;b+=3)
			{
				var red = baseConverter(r,10,16) + '';
				var green = baseConverter(g,10,16) + '';
				var blue = baseConverter(b,10,16) + '';

				var color = '#' + red + red + green + green + blue + blue;
				var div = document.createElement('DIV');
				div.style.backgroundColor=color;
				div.innerHTML = '<span></span>';
				div.className='colorSquare';
				div.title = color;
				div.onclick = chooseColor;
				div.setAttribute('rgbColor',color);
				div.onmouseover = colorPickerShowStatusBarText;
				div.onmouseout = colorPickerHideStatusBarText;
				webColorDiv.appendChild(div);
			}
		}
	}
}

function colorPickerHideStatusBarText()
{
	document.getElementById('colorPicker_statusBarTxt').innerHTML = '&nbsp;';
}

function colorPickerShowStatusBarText()
{
	var txt = this.getAttribute('rgbColor');
	if(this.title.indexOf('#')<0)txt = txt + " (" + this.title + ")";
	document.getElementById('colorPicker_statusBarTxt').innerHTML = txt;
}

function chooseColor()
{
	color_picker_form_field.value = this.getAttribute('rgbColor');
	color_picker_colorform_field.style.backgroundColor = this.getAttribute('rgbColor');
	color_picker_div.style.display='none';
}

function showColorPicker(inputObj,formField,colorformField)
{
	if(!color_picker_div)
	{
		color_picker_div = document.createElement('DIV');
		color_picker_div.id = 'dhtmlgoodies_colorPicker';
		color_picker_div.style.display='none';
		document.body.appendChild(color_picker_div);
		createColorPickerTopRow(color_picker_div);
		var contentDiv = document.createElement('DIV');
		contentDiv.id = 'color_picker_content';
		color_picker_div.appendChild(contentDiv);
		createWebColors(contentDiv);
	}
	if(color_picker_div.style.display=='none' || color_picker_active_input!=inputObj)color_picker_div.style.display='block'; else color_picker_div.style.display='none';
	color_picker_div.style.left = colorPickerGetLeftPos(inputObj) + 'px';
	color_picker_div.style.top = colorPickerGetTopPos(inputObj) + inputObj.offsetHeight + 2 + 'px';
	color_picker_form_field = formField;
	color_picker_colorform_field = colorformField;
	color_picker_active_input = inputObj;
}

//-->
</script>

<div class="panel bg3" id="am-panel">
	<div class="inner"><span class="corners-top"><span></span></span>
	<!-- IF S_SHOW_AM_BOX -->
	<p>{L_ADD_AM_EXPLAIN}</p>
	<!-- ENDIF -->

	<fieldset class="am_regposting">
	<dl>
		<dt style="display:none;"><label for="am_options_table">{L_AM_OPTIONS}:</label><br /><span>{L_AM_OPTIONS_EXPLAIN}</span></dt>
		<dd style="display:none;">
			<table id="am_options_table" border="0" cellspacing="0" cellpadding="0" style="display:none;">
				<tbody></tbody>
			</table>
			<input type="button" value="{L_AM_ADD_OPTION}" onclick="addRowToTable();" class="button2" />
		</dd>
	</dl>

	<hr class="dashed" />

	<dl>
		<dt><label for="am_preset">{L_AM_PRESET}:</label><br /><span>{L_AM_PRESET_EXPLAIN}</span></dt>
		<dd><label for="am_preset">
			<select name="am_preset" id="am_preset">{S_AM_PRESET_OPTIONS}</select>
			<input type="button" onClick="preset();" value="GO" class="button2">			
			</label>
		</dd>
	</dl>

	<dl>
		<dt style="display:none;"><label for="am_layout">{L_AM_LAYOUT}:</label><br /><span>{L_AM_LAYOUT_EXPLAIN}</span></dt>
		<dd style="display:none;"><label for="am_layout">
			<select name="am_layout" id="am_layout">{S_AM_LAYOUT_OPTIONS}</select>
			</label>
		</dd>
	</dl>
	<dl>
		<dt style="display:none;"><label for="am_length">{L_AM_FOR}:</label></dt>
		<dd style="display:none;"><label for="am_length"><input type="text" name="am_length" id="am_length" size="3" maxlength="3" value="{AM_LENGTH}" class="inputbox autowidth" /> {L_DAYS}</label></dd>
		<dd style="display:none;">{L_AM_FOR_EXPLAIN}</dd>
	</dl>
	<dl>
		<dt style="display:none;"><label for="am_reg_change">{L_AM_REG_CHANGE}:</label></dt>
		<dd style="display:none;"><label for="am_reg_change"><input type="checkbox" id="am_reg_change" name="am_reg_change"{AM_REG_CHANGE_CHECKED} /> {L_AM_REG_CHANGE_EXPLAIN}</label></dd>
	</dl>
	<dl>
		<dt style="display:none;"><label for="am_confirmable">{L_AM_CONFIRMABLE}:</label></dt>
		<dd style="display:none;"><label for="am_confirmable"><input type="checkbox" id="am_confirmable" name="am_confirmable"{AM_CONFIRMATION_CHECKED} /> {L_AM_CONFIRMABLE_EXPLAIN}</label></dd>
	</dl>
	<dl>
		<dt style="display:none;"><label for="am_visible">{L_AM_VISIBLE}:</label></dt>
		<dd style="display:none;"><label for="am_visible"><input type="checkbox" id="am_visible" name="am_visible"{AM_ACTIVATE_CHECKED} /> {L_AM_VISIBLE_EXPLAIN}</label></dd>
	</dl>

	</fieldset>
	<span class="corners-bottom"><span></span></span></div>
</div>
Please note that this means that you will need to define your presets via the ACP and that by undertaking this method neither the slots or names of the registrations will be able to be defined by the user.

It will take me some time before I will get a chance to look into incorporating this functionality into the AM mod as a separate option.

Please let me know how you go with this.

Please note that this edit to the am mod is not a recommended modification and is undertaken at the user's own risk.

Depending on the interest from others on this I may down the track decide to write this up properly for the AM mod.
User avatar
Volksdevil
Registered User
Posts: 2415
Joined: Sun Oct 03, 2010 2:03 pm
Location: Lancashire, UK
Name: Neil
Contact:

Re: [DEV]Simple Attendance Mod(0.0.1)

Post by Volksdevil »

Thanks for that, i may have a go with the above later! :D But for now I just installed the AM mod, it looks real good. Just a few queries though which i shall post in the AM MOD topic 8-)

Thanks for all the help with this.
My phpBB Extensions
Finally found great Website Hosting from Image KUALO!
Do NOT use 123-reg.co.uk - Incapable of running phpBB!
:ugeek: TekNeil - Streamer on Mixer | My Volkswagen Corrado G60
wired076
Registered User
Posts: 1441
Joined: Mon May 21, 2007 10:19 am

Re: [DEV]Simple Attendance Mod(0.0.1)

Post by wired076 »

Volksdevil wrote:Thanks for that, i may have a go with the above later! :D But for now I just installed the AM mod, it looks real good. Just a few queries though which i shall post in the AM MOD topic 8-)

Thanks for all the help with this.
No problems!

I have responded to your questions in the AM topic.

My pleasure.
Locked

Return to “[3.0.x] MODs in Development”