View Full Version : Advanced Templates: Dynamic Templates Changing according to different conditions
XrayHead
11-19-2003, 06:30 PM
WOW
This is yet another simply stunning hack by yourself.
Your hacks have changed my site way beyond imaginationÂ…?
Absolutely brilliant, Installs
K.Michael
11-28-2003, 08:00 PM
How to get $forumid in showthread.php ( in header and footer templates)
showtread.php small hack ?
somebody can help me ? :surprised:
thakikka
12-07-2003, 11:51 AM
Need help too :)
I want to display a message always and only in the last 7 days of a month (e.g. from 23th to 30th of each month). how can i do that?
Sadie Frost
12-09-2003, 03:49 AM
Has anyone gotten this to work with forumid, because I tried what people were posting but it's not working for me. I'm trying to make it so signatures only show in a certain forum :)
Logician
12-09-2003, 12:24 PM
Has anyone gotten this to work with forumid, because I tried what people were posting but it's not working for me. I'm trying to make it so signatures only show in a certain forum :)
$thread[forumid]==X should work in showthread related templates. (your request is so)
For forumdisplay related templates use $forumid==X
Sadie Frost
12-17-2003, 03:27 AM
Works perfectly - thanks so much! :D
Marulatree
12-17-2003, 06:45 AM
I am finding it hard to understand exactly where to put the conditionals. do I put it in Functions.php if so where. I have made the adjustments as you said to my functions.php.
All I really want to do is;
Change the header template to refect another header template for a specific forumid and for a specific group.
e.g.
Group 5 is a members only usergroup.
Forumid 8 is a members only forum.
When usergroup 5 enters forumid 8 then change the header to "Members only" forum header logo.
What would I have to do. All I need is for someone to give me the code for this as an example so I see how this works...
I am not lazy, and just need a working example so I can put my own conditionals into practice...
Many thanks in advance...
Logician
12-17-2003, 09:10 AM
I am finding it hard to understand exactly where to put the conditionals. do I put it in Functions.php if so where.
Provided that you installed the hack, you don't edit any .php files anymore to apply conditionals. These are "template conditionals" so you put them inside templates.
For instance if you want to display different header template according to different conditions, you edit your header template and apply your conditionals here.
a sample template with conditionals:
[[($bbuserinfo[usergroupid]==6)]]
show this text to admins
[[/($bbuserinfo[usergroupid]==6)]]
[[($bbuserinfo[usergroupid]==2)]]
show this text to registered users
[[/($bbuserinfo[usergroupid]==2)]]
show this text everybody else who is not registered user nor admin.
Needless to say you'll replace "show this text" texts with HTML code that you want to display
Marulatree
12-17-2003, 09:25 AM
Provided that you installed the hack, you don't edit any .php files anymore to apply conditionals. These are "template conditionals" so you put them inside templates.
For instance if you want to display different header template according to different conditions, you edit your header template and apply your conditionals here.
a sample template with conditionals:
Needless to say you'll replace "show this text" texts with HTML code that you want to display
Hmmm...thanks for the fast reply! I am still a little slow on the take here.
So in my HEADER template, If I would say use; usergroup 6 to get a different HEADER (Banner,logo etc.) to view when they click into the Member Club forum, What code would I use for VB to see that it needs to change the header to an entirely differently designed Header?
Would I need to create an alternative HEADER (say HEADER2) template? What would the exact code be?
Sorry to be a pain!!!
Marulatree
12-17-2003, 09:59 AM
Here's my original header:
<table width="100%" border="0" cellpadding="0" cellspacing="0" dwcopytype="CopyTableRow">
<tr>
<td width="14%"><img src="images/forumlogoxmas.gif" width="229" height="71"></td>
<td width="86%" background="images/bs2.gif"><div align="center"><a href="http://www.jpg.com/cgi-bin/betaSchool.exe/sendtomain" target="_blank"><img src="http://www.******.com/images/jpg.jpg" border=0></a></div></td>
</tr>
<tr>
</tr>
</table>
<!-- toplinks -->
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<td align="center"><a href="http://www.*******.com/"><img src="{imagesfolder}/top_home.gif" alt="Hompage" border="0"></a>
<a href="usercp.php?s=$session[sessionhash]"><img src="{imagesfolder}/top_profile.gif" alt="Here you can view your subscribed threads, work with private messages and edit your profile and preferences" border="0"></a>
<a href="register.php?s=$session[sessionhash]&action=signup"><img src="{imagesfolder}/top_register.gif" alt="Registration is free!" border="0"></a>
<a href="calendar.php?s=$session[sessionhash]"><img src="{imagesfolder}/top_calendar.gif" alt="Calendar" border="0"></a>
<a href="http://forum.marulatree.com/proarcade.php?action=arcade&s=$session[sessionhash]"><img src="{imagesfolder}/arcade.gif" alt="Med's Arcade - Can you Beat the high Score?" border="0"></a>
<a href="memberlist.php?s=$session[sessionhash]"><img src="{imagesfolder}/top_members.gif" alt="Find other members" border="0"></a>
<a href="misc.php?s=$session[sessionhash]&action=faq"><img src="{imagesfolder}/top_faq.gif" alt="Frequently Asked Questions" border="0"></a>
<a href="search.php?s=$session[sessionhash]"><img src="{imagesfolder}/top_search.gif" alt="Search" border="0"></a>
<a href="member.php?s=$session[sessionhash]&action=logout"><img src="{imagesfolder}/top_logout.gif" alt="Logout" border="0"></a>
<a href="http://www.********.com/gallery/"><img src="http://www.******.com/forum/images/gallery.gif" alt="Browse the Gallery" border="0"></a>
<a href="http://www.*******.com/mtchat/"><img src="{imagesfolder}/livechat.gif" alt="Join Live Chat" border="0"></a></td></table>
<!-- /toplinks -->
The usergroup is (lets say): 3
The Forumid is: 8
If usergroup 3 logs into Forumid 8 change header to:
A newley desiger header with a different logo, banner etc...
Marulatree
12-17-2003, 10:20 AM
:( Please, I know I'm been a pain in the royal ass, but please...***resorts to begging****
Logician
12-17-2003, 01:12 PM
change your header template like this:
[[($bbuserinfo[usergroupid]==3 AND ($forumid==8 OR $thread[forumid]==8))]]
put your custom header's html code here
[[/($bbuserinfo[usergroupid]==3 AND ($forumid==8 OR $thread[forumid]==8))]]
put your regular header code here
Marulatree
12-17-2003, 01:47 PM
Ahhhhhhhhhhhhhhhhh.....you beauty!!! Many thanks for helping a real pain in the ass!!! :)
Marulatree
12-17-2003, 02:13 PM
oooops, Spoke to soon,
I have done that now and it add's my additional code in, but still inserts the original header information as well...any ideas? Maybe some type if IF statement to not include the original HEADER if userid you are userid 3?
Logician
12-17-2003, 04:53 PM
ok try this:
[[(($bbuserinfo[usergroupid]==3 AND ($forumid==8 OR $thread[forumid]==8)))]]
put your custom header's html code here
[[/(($bbuserinfo[usergroupid]==3 AND ($forumid==8 OR $thread[forumid]==8)))]]
[[(!($bbuserinfo[usergroupid]==3 AND ($forumid==8 OR $thread[forumid]==8)))]]
put your regular header code here
[[/(!($bbuserinfo[usergroupid]==3 AND ($forumid==8 OR $thread[forumid]==8)))]]
Marulatree
12-17-2003, 06:03 PM
ok try this:
[[(($bbuserinfo[usergroupid]==3 AND ($forumid==8 OR $thread[forumid]==8)))]]
put your custom header's html code here
[[/(($bbuserinfo[usergroupid]==3 AND ($forumid==8 OR $thread[forumid]==8)))]]
[[(!($bbuserinfo[usergroupid]==3 AND ($forumid==8 OR $thread[forumid]==8)))]]
put your regular header code here
[[/(!($bbuserinfo[usergroupid]==3 AND ($forumid==8 OR $thread[forumid]==8)))]]
I have explained what goes wrong in the below comments in the code:
[[(($bbuserinfo[usergroupid]==6 AND ($forumid==23 OR $thread[forumid]==23)))]]
This displays the different header perfectly when this usergroup logs into this forumid....
[[/(($bbuserinfo[usergroupid]==6 AND ($forumid==23 OR $thread[forumid]==23)))]]
[[(!($bbuserinfo[usergroupid]==1 AND ($forumid==8 OR $thread[forumid]==8)))]]
This is where the problem comes in....What ever I put in this condition it duplicates it underneath the new different HEADER.
[[/(!($bbuserinfo[usergroupid]==1 AND ($forumid==8 OR $thread[forumid]==8)))]]
Logician
12-17-2003, 06:08 PM
well this is because you dont use my exact code, you change it. For instance usergroup numbers are changed in your quoted code.
My code will work ok for the given condition which you asked in the first place:
"If usergroup 3 logs into Forumid 8 change header to:"
Marulatree
12-17-2003, 06:22 PM
ha-ha - Man I feel like a dumbass!!! Logican you are a pure genius, really!!! Thank you very very much!
Marulatree
12-17-2003, 06:37 PM
.....I just can't get it!
-------------------------
Usergroupid's 2 and 3 that should see OLD HEADER when they click into
Forumid's: 21,3,4,17,26,27,24,20,25,32,7,33,34,35,30,8,5,29,9
-------------------------
AND
-------------------------
Usergroupid's 6,7 and 9 that should see NEW HEADER when they click into
Forumid's: 23 and 28. When these user id's click on any other forumid's the banner needs to return to the OLD HEADER state.
-------------------------
All I want to do is if a Member's Club member (userid: 6,7 and 9) enter the Members Club forum (forumid's 28 and 23) they get greeted with Member welcome HEADER and if they exit or go to another forum (forumid's: 21,3,4,17,26,27,24,20,25,32,7,33,34,35,30,8,5,29 and 9) they get that Normal HEADER (I would also like to include the FORUMHOME HEADER to be the normal HEADER all round for every member.
I just can't get it right! I tried and tried using your tutorial on the first page and no luck!
I hope I'm not giving you a headache (I hope headache ain't contageous :))
Logician
12-18-2003, 08:02 AM
[[((($bbuserinfo[usergroupid]==6 OR $bbuserinfo[usergroupid]==7 OR $bbuserinfo[usergroupid]==9) AND ($forumid==28 OR $thread[forumid]==28 OR $forumid==23 OR $thread[forumid]==23)))]]
put your custom header's html code here
[[/((($bbuserinfo[usergroupid]==6 OR $bbuserinfo[usergroupid]==7 OR $bbuserinfo[usergroupid]==9) AND ($forumid==28 OR $thread[forumid]==28 OR $forumid==23 OR $thread[forumid]==23)))]]
[[(!(($bbuserinfo[usergroupid]==6 OR $bbuserinfo[usergroupid]==7 OR $bbuserinfo[usergroupid]==9) AND ($forumid==28 OR $thread[forumid]==28 OR $forumid==23 OR $thread[forumid]==23)))]]
put your regular header code here
[[/(!(($bbuserinfo[usergroupid]==6 OR $bbuserinfo[usergroupid]==7 OR $bbuserinfo[usergroupid]==9) AND ($forumid==28 OR $thread[forumid]==28 OR $forumid==23 OR $thread[forumid]==23)))]]
This will do the trick for your request. Though it will work only in forumdisplay pages, not thread read pages. I take a look at the showthread.php and see that changing the header inside threads is not possible with this hack.
Also you may consider trying unique forum header hack which changes forum headers according to forumid. Although it does not change according to usergroup, if you make that forum private and allow only these usergroups can access it, this wont be a problem.
Marulatree
12-18-2003, 02:23 PM
nope - that didn't work.
It puts this prints back to code all over the top of my page:
[[(((6==6 OR 6==7 OR 6==9) AND (23==28 OR ==28 OR 23==23 OR ==23)))]] Please ingnore [[/((6==3 AND (23==8 OR ==8)))]] [[(!(6==3 AND (23==8 OR ==8)))]] Please ingnore [[/(!((6==6 OR 6==7 OR 6==9) AND (23==28 OR ==28 OR 23==23 OR ==23)))]]
Logician
12-18-2003, 06:17 PM
previous post edited, try again
Marulatree
12-19-2003, 02:38 PM
Puuurrrrfect! - That woulded like a charm! Thanks for all your help!
daFish
12-19-2003, 03:47 PM
Hiho,
first of all: wonderfull and great hack, Logician. :)
But now my question:
Whats the variable where the Style ID is stored when a member is logged in?
-Fish
Logician
12-19-2003, 07:14 PM
Whats the variable where the Style ID is stored when a member is logged in?
what style id are you referring to? if it is user's style choice, try $bbuserinfo[styleid]
Frozen Dreams
12-20-2003, 06:51 AM
Can I just say that this hack rocks?!
Since seriously it does. I cant believe I never saw this any earlier. Would have saved me so much brainwrecking it aint funny. Two thumbs up - this is really awesome work.
ETA:
Either I am too tired or just too blonde :p
Could someone help me with the following conditional:
1.) Certain Number of PMs in all Folders and Certain Usergroup (I have PM Quota per Usergroup hack installed). Notice to go onto Index and into the private messaging templates.
2.) Birthday note on index. I fiddled around but I just couldnt get it right :(
I dont want to use the Dynamic Announcement for either of both since I am using that for something else - and well I just have the announcement variable as a global one and in too many templates.
Mighty thanks in advance. Help is very appriciated. :)
Kerrek Cage
12-30-2003, 06:49 PM
How would I go about creating a forum that is only open at certain times during the day, any other time it's hidden and closed to posts? Is that possible with this hack?
Logician
12-30-2003, 07:44 PM
Not really. But IIRC I gave this hack in hack requests forum to make the forum "something" (closed?) in certain times during day.
gmarik
01-01-2004, 06:13 PM
Logician
Are you remaking any of your hacks under vb3 or are you waiting for RC1? Interesting question ...
Logician
01-02-2004, 08:55 AM
Are you remaking any of your hacks under vb3 or are you waiting for RC1? Interesting question ...
Some of my hacks (like this one) become default feature in vb3 so there is no need to import them.
I will import the rest but I can not give an ETA for any of them because:
a) I have too many hacks some of which are major projects so recoding them takes time.
b) I'm busy nowadays with professional projects so I can't spend time on this converting hacks.
c) I don't plan to migrate to VB3 until its final release comes up+a few more weeks to ensure stability. So RC1 does not mean anything to me regarding my board's imigration.
Bottom line is I will recode all my hacks for VB3 but it is really not possible for me to give a date for any of them. For small projects you can expect "soon", for large ones sometime after final VB3 version comes up.
daFish
01-16-2004, 11:09 AM
Hi,
what code do i have to put in postbit template to mark the threadstarter?
Like:
Username
(Threadstarter)
digitalSite
01-23-2004, 08:42 PM
Does anyone care to share what their web site looks like? I am still having trouble trying to figure out what hack to use for my home page.
I need something that looks like vbPortal or PHPNuke, but I don't want to use those systems. I am between pluhnews, this one, and vbHome.
I want to have: calendar, latest forum threads, weather, photos, and news that I enter into a database. Anyone have any ideas?
Thanks!
Logician
01-23-2004, 08:52 PM
Does anyone care to share what their web site looks like? I am still having trouble trying to figure out what hack to use for my home page.
I need something that looks like vbPortal or PHPNuke, but I don't want to use those systems. I am between pluhnews, this one, and vbHome.
I want to have: calendar, latest forum threads, weather, photos, and news that I enter into a database. Anyone have any ideas?
Thanks!
wrong thread?
digitalSite
01-23-2004, 08:58 PM
Hi:
Well, actually, I just wanted to see some people's examples of THIS hack. I don't really know what's the difference in "look" between this hack and the others. Do you have an example on how this looks?
Logician
01-23-2004, 09:07 PM
Hi:
Well, actually, I just wanted to see some people's examples of THIS hack. I don't really know what's the difference in "look" between this hack and the others. Do you have an example on how this looks?
I think you misunderstood this hack. This is not a portal like/main page hack which can be an alternative among pluhnews,vbhome, vbportal etc.
If you know VB3's template conditional concept, this hack is its vb2 version which allows you to have dynamic (changing templates) in vb pages.
You might have intended to reply in my Webtemplate's or Logician News Hack threads though?
digitalSite
01-23-2004, 09:09 PM
Ahh, ok. I understand now. Thanks for the clarification! By the way, I love your hacks. I find them in your profile :D Take care.
Aaron1
02-16-2004, 06:37 PM
$thread[forumid]==X should work in showthread related templates. (your request is so)
For forumdisplay related templates use $forumid==X
Cool!
And how would that be for forumhome templates Logician?
I have on the forumhome a 'new thread' button besides every forum.
Already tried adding in forumhome_forumbit_level2_post the following:
[[($forumid==54)]]test[[/($forumid==54)]]
(54 = my hidden moderator forum)
But nothing shows up. Not even an error...
Or isn't that possible?
Cheers!
Logician
02-17-2004, 06:23 AM
Cool!
And how would that be for forumhome templates Logician?
I have on the forumhome a 'new thread' button besides every forum.
Already tried adding in forumhome_forumbit_level2_post the following:
[[($forumid==54)]]test[[/($forumid==54)]]
(54 = my hidden moderator forum)
But nothing shows up. Not even an error...
Or isn't that possible?
Cheers!
[[($forum[forumid]==54)]]test[[/($forum[forumid]==54)]]
Aaron1
02-17-2004, 07:51 AM
Hmm, thanks Logician, but that doesn't work. :(
Just like the previous code i tried, no errors, and nothing is to be seen.
Maybe there's another way?
Aaron1
02-22-2004, 07:18 AM
Any clues Logician? Or is it simply not possible?
Logician
02-22-2004, 07:43 AM
It didnt work here either.. Anyway try hacking:
Edit index.php, find:
eval("\$forumbits .= \"".gettemplate("forumhome_forumbit_level$depth$tempext")."\";");
Replace it as
if ($forum[forumid]!=54) {
eval("\$forumbits .= \"".gettemplate("forumhome_forumbit_level$depth$tempext")."\";");}
else {
eval("\$forumbits .= \"".gettemplate("forumhome_forumbit_54")."\";");}
Then create template named "forumhome_forumbit_54" and put any content there.
Aaron1
02-22-2004, 09:28 AM
Cool, i think it's working Logician! Thanks!
I added the extra 'forumhome_forumbit_54' template, to my $templatesused templates. So that saves me another querie i guess.
Cheers!
larryd
02-26-2004, 10:14 PM
Awesome mod, incredibly easy to install and works great :)
John Diver
03-12-2004, 10:19 AM
Hey,
I just installed this hack but with me being stupid, I installed it on my live forum instead of my test forum first.
I had the time online hack installed which recorded the time users spent on the forum.
That hack doesnt work now and it gives this error:
Fatal error: Call to undefined function: dotimeonline() in /home/hradmin/public_html/timeonline.php on line 39
I had to uninstall this hack because the forum wouldnt work at all, I have it installed on my test forum now and this is the error Im getting:
Parse error: parse error, expecting `','' or `';'' in /home/hradmin/public_html/workforum/admin/functions.php on line 163
Fatal error: Call to undefined function: getuserinfo() in /home/hradmin/public_html/workforum/admin/sessions.php on line 112
This is line 163:
if ($bbuserinfo['usergroupid'] == 6)
Just so you konw the kind of thing giving an error
Hope someone can help because I would love to use this hack!
Thanks
John
John Diver
03-12-2004, 12:37 PM
Ok i have got them fixed.
There was a problem with installing the time online hack and this at the same time, since Im not very good at PHP it took me a while to work out what to do.
Also, I read that you said there is no way to change the header for different user groups when inside a post, so it will only work on forum display pages.
Does this mean that I cant set a certain piece of HTML code to show for members that arent in a certain user group for all pages?
What I want to do is show ads on my site for guests but remove the code for the ads for registered members/admins etc. but it would have to be like this on all pages for the header and footer.
Thanks
John
Logician
03-12-2004, 01:52 PM
Does this mean that I cant set a certain piece of HTML code to show for members that arent in a certain user group for all pages?
What I want to do is show ads on my site for guests but remove the code for the ads for registered members/admins etc. but it would have to be like this on all pages for the header and footer.
Edit header template and put this in it:
[[($bbuserinfo[usergroupid]==1)]]
put your ad's html code here. It will be displayed to guest only
[[/($bbuserinfo[usergroupid]==1)]]
John Diver
03-12-2004, 02:32 PM
Thanks Logican, I thought you said the header wouldnt work when viewing posts.
I tried it on a test forum but it didnt work so I will try it again soon.
Thanks for the help, great hack, I appreciate it :)
John
Logician
03-12-2004, 02:45 PM
Thanks Logican, I thought you said the header wouldnt work when viewing posts.
I tried it on a test forum but it didnt work so I will try it again soon.
Thanks for the help, great hack, I appreciate it :)
John
Certain variables wont work in header template so my remark above applied to them only. Your request is achievable and it should work. ;)
John Diver
03-14-2004, 02:01 PM
Hey,
Thanks for the help again :)
Im having a bit of a problem though and cant work out whats wrong.
This is what Im doing:
[[($bbuserinfo[usergroupid]==1 OR $bbuserinfo[userid]==2 OR $bbuserinfo[userid]==3 OR $bbuserinfo[userid]==4 OR $bbuserinfo[userid]==5 OR $bbuserinfo[userid]==7 OR $bbuserinfo[userid]==8 OR $bbuserinfo[userid]==9)]]
Ad code
[[/($bbuserinfo[usergroupid]==1 OR $bbuserinfo[userid]==2 OR $bbuserinfo[userid]==3 OR $bbuserinfo[userid]==4 OR $bbuserinfo[userid]==5 OR $bbuserinfo[userid]==7 OR $bbuserinfo[userid]==8 OR $bbuserinfo[userid]==9)]]
What Im trying to do is ads for all member groups apart from 6 and 10.
Can you or anyone else see a problem in what I have done?
Its removing the ads for all groups, apart from guests.
So anyone logged in, or not a guest, doesnt see the ads.
Hope someone can help
Thanks
John
Logician
03-14-2004, 03:29 PM
[[($bbuserinfo[usergroupid]!=6 AND $bbuserinfo[usergroupid]!=10)]]
ad code
[[/($bbuserinfo[usergroupid]!=6 AND $bbuserinfo[usergroupid]!=10)]]
John Diver
03-14-2004, 04:00 PM
Hey,
Thank you very much, you have been a great help!
I tried that but I used OR instead of AND, I dont know very much about PHP :)
Thanks again!
John
John Diver
03-27-2004, 07:15 PM
Hey,
Me back again :)
That worked perfectly but now I am wanting to expand it a bit.
I just went through every page but everything I saw had something extra in and I dont know how to edit them to work for me as I dont know PHP.
What I want to do is have around 6 usergroups which wont see certain code in the header.
The code Im using now is working for 2 usergroups, and I tried changing it for around 6 usersgroups so instead of the 2 not seeing the code inside the conditionals, the 6 now would.
But I couldnt work out what way to do it :(
Hope you can help me out again
Thanks
John
Logician
03-27-2004, 08:06 PM
Hey,
Me back again :)
That worked perfectly but now I am wanting to expand it a bit.
I just went through every page but everything I saw had something extra in and I dont know how to edit them to work for me as I dont know PHP.
What I want to do is have around 6 usergroups which wont see certain code in the header.
The code Im using now is working for 2 usergroups, and I tried changing it for around 6 usersgroups so instead of the 2 not seeing the code inside the conditionals, the 6 now would.
But I couldnt work out what way to do it :(
Hope you can help me out again
Thanks
John
[[($bbuserinfo[usergroupid]!=X1 AND $bbuserinfo[usergroupid]!=X2 AND $bbuserinfo[usergroupid]!=X3 AND $bbuserinfo[usergroupid]!=X4 AND $bbuserinfo[usergroupid]!=X5 AND $bbuserinfo[usergroupid]!=X6)]]
ad code
[[/($bbuserinfo[usergroupid]!=X1 AND $bbuserinfo[usergroupid]!=X2 AND $bbuserinfo[usergroupid]!=X3 AND $bbuserinfo[usergroupid]!=X4 AND $bbuserinfo[usergroupid]!=X5 AND $bbuserinfo[usergroupid]!=X6)]]
Replace X1 to X6 with usergroupids.
Kaelon
03-27-2004, 08:36 PM
This is quite possibly the best hack for vB2 that I've ever used to date. Great work, Logician!
John Diver
03-28-2004, 11:31 AM
Thank you very much again Logician
This is easily the best hack I have seen, very simple (If you know how to use PHP hehe)
malcolm fraser
03-31-2004, 11:51 PM
I've been using this hack on vb2 for a long time, and it's certainly been the most useful hack I've installed - but I've just upgraded to vb3. Does anyone know if this hack will still work?? Or if there is a different or equivalent version for vb3?
Thanks.
--
Oh, just saw your signature message, Logician. No problem. I'll wait.
malcolm fraser
04-01-2004, 02:04 AM
Okay, well, I tried a few things and actually got this hack to work very easily in vb3! :)
Basically, you follow the same instructions, except the functions.php file is now in the "includes" folder.
Then, the line of code to look for is:
if ($vboptions['addtemplatename'] AND $gethtmlcomments)
Just throw the first part of the hack in before this line, and then follow exactly the same instructions for the last part of the hack.
Then follow the standard instructions to apply the conditions to your vb3 templates.
I have no idea if this is the best, or the most elegant, way of doing this - but it is working 100% successfully on my vb3.0.0 installation.
Hope this helps anyone else out there.
Logician
04-01-2004, 05:45 AM
Does anyone know if this hack will still work?? Or if there is a different or equivalent version for vb3?
Good thing you made it work in VB3 but you don't need this hack in VB3 since it involves conditional support in templates as a default feature ;) Just its syntax is different.
malcolm fraser
04-01-2004, 04:03 PM
Yeah, I noticed the "if condition" stuff in the vb3 templates and figured that's what they were - but I'm afraid I don't really know exactly how they work yet. I'm used to using your hack from vb2, so this "quick port" works out fine for now. :) If you know of anywhere I can learn more about using the default conditions in vb3, though, I'd certainly be interested.
Anyway, thanks again for this great hack - it was absolutely invaluable in vb2!
Michi
11-18-2004, 01:10 PM
Thanks, works very well with vB 2.2.7.
I needed it to do stuff according to $_SERVER['SERVER_NAME'] and by god, it works!
Adrian Schneider
12-30-2004, 04:41 AM
If you used a javascript to detect screen resolution, could you use that incombination template conditions?
Simplified: If resolution = <1024 then display this
else display this
Adrian Schneider
12-30-2004, 04:53 AM
Nevermind I think I have it. By the way good hack, I was getting sick of the weird syntax in regular template conditions, especially if statements inside of each other.
Great hack Logician! It works great!
However, I ran into a problem. I used this conditional: [[($bbuserinfo[usergroupid]==5 OR $bbuserinfo[usergroupid]==6 OR $bbuserinfo[usergroupid]==7)]] Display this HTML code if page visitor's a Super Mod OR a Mod OR an Admin [[/($bbuserinfo[usergroupid]==5 OR $bbuserinfo[usergroupid]==6 OR $bbuserinfo[usergroupid]==7)]] Where "Display this HTML code if page visitor's a Super Mod OR a Mod OR an Admin" is replaced by $adminoptions.
I used this conditional in the showthread template and it works great. But I have one forum where this Thread Options menu bar should only be shown to people who mods that forum. So I tried to use Replacements Codes: [[($bbuserinfo[usergroupid]==5 OR $bbuserinfo[usergroupid]==6 OR $bbuserinfo[usergroupid]==7)]]$adminoptions[[/($bbuserinfo[usergroupid]==5 OR $bbuserinfo[usergroupid]==6 OR $bbuserinfo[usergroupid]==7)]] to [[($bbuserinfo[userid]==1 OR $bbuserinfo[userid]==11 OR $bbuserinfo[userid]==68)]]$adminoptions[[/($bbuserinfo[userid]==1 OR $bbuserinfo[userid]==11 OR $bbuserinfo[userid]==68)]] However, it's like this Replacement thingys don't respond to what I have put there. Do you know any other solution for this?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.