PDA

View Full Version : [Release v2.0.3] Use Alternative Forum Icon


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

// 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

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.

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

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.

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.

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.

$DB_site->query("INSERT INTO forum
(forumid,styleid,title,description,active,displayo rder,parentid,
parentlist,allowposting,cancontainthreads,daysprun e,newpostemail,newthreademail,
moderatenew,allowhtml,allowbbcode,allowimages,allo wsmilies,allowicons,
styleoverride,allowratings,countposts,moderateatta ch,icon,iconname)
VALUES
(NULL,'$styleset','".addslashes($title)."','".addslashes($description)."','$isactive','$displayorder','$parentid',
'','$allowposting','$cancontainthreads','$daysprun e','".addslashes($newpostemail)."','".addslashes($newthreademail)."',
'$moderatenew','$aallowhtmlcode','$aallowbbcode',' $aallowimgcode','$aallowsmilies','$aallowicons',
'$styleoverride','$allowratings','$countposts','$m oderateattach')");


New:

$DB_site->query("INSERT INTO forum
(forumid,styleid,title,description,active,displayo rder,parentid,
parentlist,allowposting,cancontainthreads,daysprun e,newpostemail,newthreademail,
moderatenew,allowhtml,allowbbcode,allowimages,allo wsmilies,allowicons,
styleoverride,allowratings,countposts,moderateatta ch,icon,iconname)
VALUES
(NULL,'$styleset','".addslashes($title)."','".addslashes($description)."','$isactive','$displayorder','$parentid',
'','$allowposting','$cancontainthreads','$daysprun e','".addslashes($newpostemail)."','".addslashes($newthreademail)."',
'$moderatenew','$aallowhtmlcode','$aallowbbcode',' $aallowimgcode','$aallowsmilies','$aallowicons',
'$styleoverride','$allowratings','$countposts','$m oderateattach','$auseicon','$iconname')");


Old:

$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:

$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.

LanciaStratos
12-04-2001, 09:28 PM
Is this working with 2.2.x?

DelusionalMind
12-24-2001, 02:08 AM
damn fine work there! will be installing it later tonight :)

nafae
12-24-2001, 02:21 AM
yes, can it be used for 2.2.1/2.2.x? Also... can you make an .txt file with the instructions? :D

StarBuG
01-17-2002, 10:14 AM
I like the Idea but it doesn´t work for my 2.2.1g

There is no error only the gif is not displayed!

The db entries are correct and if I change a forum it´s in right in the db but it´s not displayed!

Any suggestions?

Greetings

StarBuG

Arathorn
02-05-2002, 08:37 AM
It works on 2.2.1 and 2.2.2 for me. Check your //do light bulb bit of code. Make sure it's:

$forum['onoff']=$forumicon.'on';

and not

$forum['onoff']='on';