vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   [Release v2.0.3] Use Alternative Forum Icon (https://vborg.vbsupport.ru/showthread.php?t=31173)

10-23-2001 10:00 PM

I have no idea if this hack is already submitted, but here how i hacked a alternative forum icon in place for the on/off.gif icon.

How does it like ?

The Forum:
http://tonny.gamepoint.net/images/icon_forum.gif

The Admin:
http://tonny.gamepoint.net/images/icon_admin.gif


files to edit : index.php, forumdisplay.php, admin/forum.php

Edit index.php and forumdisplay.php
Old: look for this code
PHP Code:

        // do light bulb
        
if ($bbuserinfo['lastvisitdate']=='Never') {
          
$forum['onoff']='on';
        } else {
          if (
$bbuserinfo['lastvisit']<$forum['lastpost']) {
            
$forum['onoff']='on';
          } else {
            
$forum['onoff']='off';
          }
        } 

New: replace with this code
PHP Code:

         if ($forum['icon']==1) {
            
$forumicon $forum['iconname']."_";
            if (
$forumicon == "_"$forumicon "";
         } else {
            
$forumicon "";
         }

        
// do light bulb
        
if ($bbuserinfo['lastvisitdate']=='Never') {
          
$forum['onoff']=$forumicon.'on';
        } else {
          if (
$bbuserinfo['lastvisit']<$forum['lastpost']) {
            
$forum['onoff']=$forumicon.'on';
          } else {
            
$forum['onoff']=$forumicon.'off';
          }
        } 

File: admin/forum.php (i placed those options in style part)
Old: Search this code.
PHP Code:

  maketableheader("Style Options");
  
  
makechoosercode("Custom style set for this forum","styleset","style",1);
  
makeyesnocode("Override users custom styles<BR>(will force this forums specified colors)","styleoverride",0); 

New: replace with this code
PHP Code:

  maketableheader("Style Options");
  
  
makechoosercode("Custom style set for this forum","styleset","style",1);
  
makeyesnocode("Override users custom styles<BR>(will force this forums specified colors)","styleoverride",0);
  
makeyesnocode("Enable forum icon","auseicon",0);
  
makeinputcode("Name of the icon (only shows on enable forum icon 'yes')","iconname"); 

Old: Search this code.
PHP Code:

  maketableheader("Style Options");
  
  
makechoosercode("Custom style set for this forum","styleset","style",$forum[styleid]);
  
makeyesnocode("Override users custom styles<BR>(will force this forum's specified colors)","styleoverride",$forum[styleoverride]); 

New: Replace with this code.
PHP Code:

  maketableheader("Style Options");
  
  
makechoosercode("Custom style set for this forum","styleset","style",$forum[styleid]);
  
makeyesnocode("Override users custom styles<BR>(will force this forum's specified colors)","styleoverride",$forum[styleoverride]);
  
makeyesnocode("Enable forum icon","auseicon",$forum[icon]);
  
makeinputcode("Name of the icon (only shows on enable forum icon 'yes')","iconname",$forum[iconname]); 

WARNING: this code may not be the same as yours, so check only what changes and add it to your code.

Old: This line can be different from your code
Search this code.
PHP Code:

$DB_site->query("INSERT INTO forum
                      (forumid,styleid,title,description,active,displayorder,parentid,
                       parentlist,allowposting,cancontainthreads,daysprune,newpostemail,newthreademail,
                       moderatenew,allowhtml,allowbbcode,allowimages,allowsmilies,allowicons,
                       styleoverride,allowratings,countposts,moderateattach,icon,iconname)
                   VALUES
                      (NULL,'
$styleset','".addslashes($title)."','".addslashes($description)."','$isactive','$displayorder','$parentid',
                       '','
$allowposting','$cancontainthreads','$daysprune','".addslashes($newpostemail)."','".addslashes($newthreademail)."',
                       '
$moderatenew','$aallowhtmlcode','$aallowbbcode','$aallowimgcode','$aallowsmilies','$aallowicons',
                       '
$styleoverride','$allowratings','$countposts','$moderateattach')"); 

New:
PHP Code:

$DB_site->query("INSERT INTO forum
                      (forumid,styleid,title,description,active,displayorder,parentid,
                       parentlist,allowposting,cancontainthreads,daysprune,newpostemail,newthreademail,
                       moderatenew,allowhtml,allowbbcode,allowimages,allowsmilies,allowicons,
                       styleoverride,allowratings,countposts,moderateattach,icon,iconname)
                   VALUES
                      (NULL,'
$styleset','".addslashes($title)."','".addslashes($description)."','$isactive','$displayorder','$parentid',
                       '','
$allowposting','$cancontainthreads','$daysprune','".addslashes($newpostemail)."','".addslashes($newthreademail)."',
                       '
$moderatenew','$aallowhtmlcode','$aallowbbcode','$aallowimgcode','$aallowsmilies','$aallowicons',
                       '
$styleoverride','$allowratings','$countposts','$moderateattach','$auseicon','$iconname')"); 

Old:
PHP Code:

  $DB_site->query("UPDATE forum
                   SET 
                     styleid='
$styleset', title='".addslashes($title)."', description='".addslashes($description)."',                                                      active='$isactive', displayorder='$displayorder', parentid='$parentid', parentlist=$parentlist,                                                       allowposting='$allowposting', cancontainthreads='$cancontainthreads', daysprune='$daysprune',
                     newpostemail='"
.addslashes($newpostemail)."', newthreademail='".addslashes($newthreademail)."',
                     moderatenew='
$moderatenew', allowhtml='$aallowhtmlcode', allowbbcode='$aallowbbcode',
                     allowimages='
$aallowimgcode', allowsmilies='$aallowsmilies', allowicons='$aallowicons',                                                               styleoverride='$styleoverride', allowratings='$allowratings', countposts='$countposts',
                     moderateattach='
$moderateattach' WHERE forumid='$forumid'"); 

New:
PHP Code:

  $DB_site->query("UPDATE forum
                   SET 
                     styleid='
$styleset', title='".addslashes($title)."', description='".addslashes($description)."',                                                      active='$isactive', displayorder='$displayorder', parentid='$parentid', parentlist=$parentlist,                                                       allowposting='$allowposting', cancontainthreads='$cancontainthreads', daysprune='$daysprune',
                     newpostemail='"
.addslashes($newpostemail)."', newthreademail='".addslashes($newthreademail)."',
                     moderatenew='
$moderatenew', allowhtml='$aallowhtmlcode', allowbbcode='$aallowbbcode',
                     allowimages='
$aallowimgcode', allowsmilies='$aallowsmilies', allowicons='$aallowicons',                                                               styleoverride='$styleoverride', allowratings='$allowratings', countposts='$countposts',
                     moderateattach='
$moderateattach', icon='$auseicon', iconname='$iconname'
                   WHERE forumid='
$forumid'"); 

Mysqltable:

[QUOTE]Mysql> ALTER table forum add icon smallint not null default"0", add iconname char(50) not null;

snyx 10-24-2001 03:01 PM

wicked hack man, but do the "funny fourm icons" have on or off capablitys or are they just one type?

Admin 10-24-2001 03:09 PM

[QUOTE]Originally posted by Aq.
ftp/copy {name}_on.gif / {name}_off.gif in the forum images

Neo 10-24-2001 03:22 PM

wow never thought to have a hack that does this. bad @$$ :D

Bane 10-24-2001 04:48 PM

Nice hack Aq :)

Aq. 10-24-2001 05:03 PM

hehe, thanks,
never saw such a hack come up in the new version, neither in the older version, (maeby i didn't see) so i posted it
and i knew some ppl would appriciate this hack :)

Could have done more fancy stuff but i was little lazy! :P

And guys from vbb, keep up with the good work! there are some lazy stuff but hehe ;)

snyx 10-24-2001 05:58 PM

LOL! Thanks FireFly, wow, shows how much I don't pay attention in the morning! :p

Dark Blaze 11-30-2001 11:52 AM

Awsome hack :)

Exactly what I needed for my forum.

I'm going to install it very soon indeed. As soon as I'm back online, this hack will be part of my vB scripts ;)

Lesane 11-30-2001 04:28 PM

Great Hack, Thanks Aq

philphee 12-01-2001 11:58 PM

Nice one, I like it.


All times are GMT. The time now is 01:36 AM.

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.01101 seconds
  • Memory Usage 1,806KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (10)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete