Announcement

Collapse
No announcement yet.

[RELEASE] Avatar Posts Hack

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [RELEASE] Avatar Posts Hack

    This one is almost a template modification, but here it is since it hacks avatar.php.

    When adding multiple avatars, you can use the "Check All" box to select them all, but you still have to type in the desired number of posts for each if "0" is not what you are after.

    So, I added a little JavaScript to let you set them all to the same number. This is especially useful if you are importing all your old avatars from Freddie's original hack, and they are already organized into directories based on post numbers.

    In avatar.php in the Admin directory, find the JavaScript section that contains:
    PHP Code:
    <script language="JavaScript">
    <!--
    function 
    CheckAll() 
    Add this function after the CheckAll function and before the CheckCheckAll function (it really does not matter where you add it; that is just were I put it in the SCRIPT block):
    Code:
    function ChangeAll()
    {
    	var textboxcount=0;
    	for (var i=0;i<document.form.elements.length;i++)
    	{
    		var e = document.form.elements[i];
    		if ((e.name != 'allavatarposts') && (e.type=='text'))
    		{
    			textboxcount++;
    			if (textboxcount % 2==0)
    				e.value = document.form.allavatarposts.value;
    		}
    	}
    }
    Then find:
    Code:
    <td align='center'><span class='tblhead'><b>Minimum Posts</b></span></td>";
    and change it to:
    Code:
    <td align='center'><span class='tblhead'><b>Minimum Posts</b></span><br><input name='allavatarposts' type='text' size=8 value='0' onChange='ChangeAll();'></td>";
    to add the AllAvatarPosts text box to the table's title bar.

    That is it. When you upload multiple avatars, you can now type in a value in the AllAvatarPosts box, then check the CheckAll check box, and all the avatars are uploaded with the same post threshold value.
    Last edited by phumphries; Tue 4th Sep '01, 7:29am.
    Peter E. Humphries

  • #2
    What version does this hack work with?
    http://www.tchracing.com/forums/live...h_live_sig.jpg

    Comment


    • #3
      I have 2.0.3, but it should work with any of the 2.0.x releases.

      The hack just adds some JavaScript to the Avatar import page.
      Peter E. Humphries

      Comment


      • #4
        Where do I install this hack?
        http://www.tchracing.com/forums/live...h_live_sig.jpg

        Comment


        • #5
          avatar.php in the Admin directory.

          I have clarified the instructions. Sorry about that.
          Peter E. Humphries

          Comment


          • #6
            Found it, thanks a lot great hack.
            http://www.tchracing.com/forums/live...h_live_sig.jpg

            Comment

            widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
            Working...
            X