Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 12-04-2011, 06:08 PM
accludetuner accludetuner is offline
 
Join Date: Jun 2009
Posts: 75
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default AdminCP Pages - small cosmetic issues questions

I'm having issues with 2 small things that are cosmetic related for an adminCP page.

1. I can't get the "check all" box to actually work. Checkbox elements appear, and all of the element values like name, id, value, seem to be added to them just fine. When you hover over the box, it doesn't display the value like it's supposed to and when you click the "check all" box it has no effect The "reset" button is also not working and I think they're related. It's probably something simple but I've been messing with it for hours and my head is starting to hurt Tried several variations of the code below but this is the latest revision:

Code:
			//lets start putting the page together with all the elements described above
			print_cp_header('Thread Creation');
			print_table_start('download2newthreadadmin');
			print_table_header("Files Without Threads - Total entries: $logs - Page: $page of $totalpages", 5);

			echo '<tr><td class="thead">User</td><td class="thead">File</td><td class="thead">Date</td><td class="thead">File Size</td><td class="thead"><strong>Create Thread?</strong><br /><input type="checkbox" name="allbox" title="'.$vbphrase[check_all].'" onclick="js_check_all(this.form);" /><label for="allbox">'.$vbphrase[check_all].'</label></td></tr>';

			while ($filelist = $db->fetch_array($result))
			{
				$class = fetch_row_bgclass();
				echo '<tr><td class="'.$class.'"><a href="user.php?' . $vbulletin->session->vars['sessionurl'] . 'do=edit&amp;u='.$filelist['uploaderid'].'">'.$filelist['uploader'].'</a></td><td class="'.$class.'"><a href="../downloads.php?do=file&amp;id='.$filelist['id'].'">'.$filelist['name'].'</a></td><td class="'.$class.'"><span class="smallfont">'.vbdate($vbulletin->options['logdateformat'], $filelist['date']).'</span></td><td class="'.$class.'">'.vb_number_format($filelist['size'], 0, true).'</td><td class="'.$class.'"><input type="checkbox" name="'.$filelist['name'].'" id="'.$filelist['id'].'" value="'.$filelist['name'].'" /><label for="'.$filelist['name'].'">'.$vbphrase[yes].'</label></td></tr>';


			} //end of while loop for while ($filelist = $db->fetch_array($result))

			print_label_row("$firstpage $prevpage &nbsp; $nextpage $lastpage");
			print_submit_row('Create Threads for Selected Files');

			print_cp_footer();

Here's what that code produces in raw HTML with a few comments added:

Code:
<table class="tborder" width="90%" cellspacing="0" cellpadding="4" border="0" align="center" style="border-collapse:separate">
<tbody>
<tr>
<td class="tcat" align="center" colspan="5">
<b>Files Without Threads - Total entries: 163 - Page: 1 of 33</b>
</td>
</tr>
<tr>
<td class="thead">User</td>
<td class="thead">File</td>
<td class="thead">Date</td>
<td class="thead">File Size</td>

//here's the section for the "check all" box
<td class="thead">
<strong>Create Thread?</strong>
<br>
<input type="checkbox" onclick="js_check_all(this.form);" title="Check All" name="allbox">
<label for="allbox">Check All</label>
</td>
//end "check all" box

</tr> // finish off the table header


//here's where each entry starts, beginning of entry 1
<tr>
<td class="alt1">
<a href="user.php?do=edit&u=23">patrick4588</a>
</td>
<td class="alt1">
<a href="../downloads.php?do=file&id=163">HiPoint 995</a>
</td>
<td class="alt1">
<span class="smallfont">19:36, 11th Jul 2011</span>
</td>
<td class="alt1">4.02 MB</td>
<td class="alt1">
<input id="163" type="checkbox" value="HiPoint 995" name="HiPoint 995">
<label for="HiPoint 995">Yes</label>
</td>
</tr>
//end of entry 1

//code repeats TR and TD tags properly for all other entries in the table, and all entries have proper info pulled from the DB and displayed.  This would be entry 2 and so on....
<tr><td></td></tr> // end of entry 2
<tr><td></td></tr> // end of entry 3, blah
<tr><td></td></tr> // end of entry 4, and so on

//finished listing all items in the table so on to the bottom

//start pagination code
<tr valign="top">
<td class="alt2">
<input class="button" type="button" onclick="window.location='download2newthreadadmin.php?do=precreate&throttle=5&createtype=selectivecreate&page=2'" tabindex="1" value="Next Page >">
<input class="button" type="button" onclick="window.location='download2newthreadadmin.php?do=precreate&throttle=5&createtype=selectivecreate&page=33'" tabindex="1" value="Last Page ?">
</td>
<td class="alt2">&nbsp;</td>
</tr>
//end pagination code

//buttons for "create" and "reset"
<tr>
<td class="tfoot" align="center" colspan="2">
<input id="submit0" class="button" type="submit" accesskey="s" value="Create Threads for Selected Files" tabindex="1">
<input id="reset0" class="button" type="reset" accesskey="r" value=" Reset " tabindex="1">
</td>
</tr>
//end "create" and "reset" buttons

</tbody>
</table>


The second issue relates to the same code above and should be easy but I've had no luck.

How do I get :

Code:
			print_label_row("$firstpage $prevpage &nbsp; $nextpage $lastpage");
			print_submit_row('Create Threads for Selected Files');
to span 5 columns so that it lines up nice and pretty with the rest of the table? They're both only spanning 2 cols and I've tried adding a ", 5" at the end, in the middle and at the beginning of those two and had no luck.


Sorry for begging for help with such petty stuff but I've got a headache from staring at it for too long




--------------- Added [DATE]1323030762[/DATE] at [TIME]1323030762[/TIME] ---------------



Holy crap I'm retarded!

Figured out problem one. Seems I was so focused on the actual checkboxes and element values that I completely forgot to make the elements part of a form.

Adding this above print_table_header fixed it:
Code:
print_form_header('download2newthreadadmin', 'createthreads');

So now I just help with colspan issue in problem #2. Thanks in advance!
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:50 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03436 seconds
  • Memory Usage 2,168KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (4)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete