Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Oct 2003
Posts: 3
Lurker
Lurker
Offline
Joined: Oct 2003
Posts: 3
I am attempting to give different forums different post icons. I have been able to do this for one board but I cannot seem to get it to work for more then one. Also working off of 6.0.2

Any ideas?

This is the line of code I have changed to make it work so far.

if ($Board=='gnews') {
$iconselect = $html -> icon_news();
$instant_ubbcode = $html -> instant_ubbcode();
}

else {
$iconselect = $html -> icon_select();
$instant_ubbcode = $html -> instant_ubbcode();
}

Sponsored Links
Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
if ($Board=='gnews') {
$iconselect = $html -> icon_news();
$instant_ubbcode = $html -> instant_ubbcode();
}
elseif ($Board=='xnews') {
$iconselect = $html -> icon_xnews();
$instant_ubbcode = $html -> instant_ubbcode();
}
elseif ($Board=='cnews') {
$iconselect = $html -> icon_cnews();
$instant_ubbcode = $html -> instant_ubbcode();
}
elseif ($Board=='anews') {
$iconselect = $html -> icon_anews();
$instant_ubbcode = $html -> instant_ubbcode();
}
elseif ($Board=='bnews') {
$iconselect = $html -> icon_bnews();
$instant_ubbcode = $html -> instant_ubbcode();
}
elseif ($Board=='fnews') {
$iconselect = $html -> icon_fnews();
$instant_ubbcode = $html -> instant_ubbcode();
}
else {
$iconselect = $html -> icon_select();
$instant_ubbcode = $html -> instant_ubbcode();
}

I hope you follow the premise here

Joined: Oct 2003
Posts: 3
Lurker
Lurker
Offline
Joined: Oct 2003
Posts: 3
That is what i was forgetting elseif i knew it was something simple.

On a related note the icon_xnews after Iconselect. Where exactly does that point to? I wrote the code so long ago I can even remember how it worked fully

Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
What I am saying by using xnews gnews is that you already defined another set of post icons by icon_news instead of using icon_select so if you want even more variations you need to define other ones. Code as you like Say if you want only 3 boards to use the ONE new set of icons you specify the code would look like this instead of the elseif's

if ($Board=='gnews' && $Board=='xnews' && $Board=='anews') {
$iconselect = $html -> icon_news();
$instant_ubbcode = $html -> instant_ubbcode();
}

else {
$iconselect = $html -> icon_select();
$instant_ubbcode = $html -> instant_ubbcode();
}

elseif is good if you are going to define a specific set for each board you have if you want more than one extra style of something

If you want to use just the one new set then say the rest will use the default set then may the && will work for you


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Gizmo
Gizmo
Portland, OR, USA
Posts: 5,833
Joined: January 2000
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20240506)