IF variable for forum id?

Discussion forum for MOD Writers regarding MOD Development.
regazer
Registered User
Posts: 69
Joined: Sun Sep 08, 2013 7:11 pm
Name: Reginald Gazer

Re: IF variable for forum id?

Post by regazer »

Sorry, I also didn't find out which file you have to edit for that.

I only showed you THE WAY HOW instead of your trial.

My orientation for that based on the following part of overall_header.html from the style prosilver Special Edition ( se_pro_1.0.7 )

Code: Select all

			<!-- IF SCRIPT_NAME == "faq" --><div class="header-bar" style="background-image: url({T_THEME_PATH}/images/bg_header2.jpg); background-position: top;">
			<!-- ELSEIF SCRIPT_NAME == "search" --><div class="header-bar" style="background-image: url({T_THEME_PATH}/images/bg_header3.jpg); background-position: top;">
			<!-- ELSEIF SCRIPT_NAME == "memberlist" --><div class="header-bar" style="background-image: url({T_THEME_PATH}/images/bg_header4.jpg); background-position: top;">
			<!-- ELSEIF SCRIPT_NAME == "ucp" --><div class="header-bar" style="background-image: url({T_THEME_PATH}/images/bg_header5.jpg); background-position: top;">
			<!-- ELSEIF SCRIPT_NAME == "viewtopic" --><div class="header-bar" style="background-image: url({T_THEME_PATH}/images/bg_header6.jpg); background-position: top;">
			<!-- ELSEIF SCRIPT_NAME == "viewforum" --><div class="header-bar" style="background-image: url({T_THEME_PATH}/images/bg_header7.jpg); background-position: top;">
			<!-- ELSEIF SCRIPT_NAME == "mcp" --><div class="header-bar" style="background-image: url({T_THEME_PATH}/images/bg_header8.jpg); background-position: top;">
			<!-- ELSEIF SCRIPT_NAME == "posting" --><div class="header-bar" style="background-image: url({T_THEME_PATH}/images/bg_header9.jpg); background-position: top;">
			<!-- ELSE --><div class="header-bar"><!-- ENDIF -->
That code uses other top backgrounds based/sorted by the SCRIPT_NAME.
User avatar
Talk19Zehn
Registered User
Posts: 912
Joined: Tue Aug 09, 2011 1:10 pm

Re: IF variable for forum id?

Post by Talk19Zehn »

Hi,
atoirtap wrote:I would like to add a small link besides the name/description of a forum link.
... why do not go an easy, directly way by BBCode URL into the respective forums description (ACP)?

Description: example

Code: Select all

Snippets for phpBB-3.0
[url=http://www.example.com]Please read more ... whatever[/url]
BTW: Examples of another "gimmicks" ;) in the viewforum_body.html can be found here: german language(!) -> http://www.ongray-design.de/forum/viewt ... 2575#p2575
atoirtap
Registered User
Posts: 63
Joined: Thu Aug 01, 2013 8:34 pm

Re: IF variable for forum id?

Post by atoirtap »

Hi buddy, thanks for answering. Well, actually I would like to add some html content (which includes a link and some other stuff) near some forum-links, and that content would depend on the specific forum-link ID.

I thought getting that goal with just a few php lines, but (I don't know exactly why) I can't get it work out. Well, I suppose I can add the content 'manually', but it's a quite 'poor' solution, and quite irritating.
User avatar
Lumpy Burgertushie
Registered User
Posts: 69228
Joined: Mon May 02, 2005 3:11 am

Re: IF variable for forum id?

Post by Lumpy Burgertushie »

I have not tested but this should work.
if you only have one forum that you would like this to work on, then just this:

Code: Select all

<!-- IF FORUM_ID eq 'whatever1' --><a href="blah1">bleh1</a><-- ENDIF -->
if you have several different forums that you want to put different information for, then this:

Code: Select all

<!-- IF FORUM_ID eq 'whatever1' --><a href="blah1">bleh1</a>
<!-- ELSEIF FORUM_ID eq 'whatever2' --><a href="blah2">bleh2</a>
<!-- ELSEIF FORUM_ID eq 'whatever*' --><a href="blah*">bleh*</a><-- ENDIF -->
no need to edit any php files etc.

a forum is a forum the forum ID is the forum ID. It doesn't matter if it is a forum or a category or a link forum etc.


robert
Premium phpBB 3.3 Styles by PlanetStyles.net

I am pleased to announce that I have completed the first item on my bucket list. I have the bucket.
regazer
Registered User
Posts: 69
Joined: Sun Sep 08, 2013 7:11 pm
Name: Reginald Gazer

Re: IF variable for forum id?

Post by regazer »

Hi, Robert !

So far it's right what you say and what I told before here viewtopic.php?f=71&t=2107411#p14052306 but the problem is that it DON'T work within forumlist_body.html. It has to be elsewhere, but I didn't find out which file. Otherwise I had reported that.
atoirtap
Registered User
Posts: 63
Joined: Thu Aug 01, 2013 8:34 pm

Re: IF variable for forum id?

Post by atoirtap »

Yep, I've just checked it and it doesn't work. Ok buddies, don't waste your time, I'll do it just 'manually', adding the stuff in the forum-link description field. Thank you all anyway.
regazer
Registered User
Posts: 69
Joined: Sun Sep 08, 2013 7:11 pm
Name: Reginald Gazer

Re: IF variable for forum id?

Post by regazer »

Oh guys and girls, I think found it. The file forumlist_body.html was right.

BUT is hasn't to be only "FORUM_ID". It has to be "forumrow.FORUM_ID" :lol:

Maybe that in older versions only FORUM_ID had been enough.

in the file forumlist_body.html:

Code: Select all

<!-- IF forumrow.FORUM_ID eq '2' --><a href="link2">2</a>
<!-- ELSEIF forumrow.FORUM_ID eq '3' --><a href="link3">3</a>
<!-- ELSEIF forumrow.FORUM_ID eq '4' --><a href="link4">4</a>
<!-- ELSE -->forumrow.FORUM_ID = {forumrow.FORUM_ID}
<!-- ENDIF -->
To do the same with topics it has to look something like this (in the file viewforum_body.html) :

Code: Select all

<!-- IF topicrow.TOPIC_ID eq '2' --><a href="link2">2</a>
<!-- ELSEIF topicrow.TOPIC_ID eq '3' --><a href="link3">3</a>
<!-- ELSEIF topicrow.TOPIC_ID eq '4' --><a href="link4">4</a>
<!-- ELSE -->topicrow.TOPIC_ID = {topicrow.TOPIC_ID}
<!-- ENDIF -->
I renamed something to show how it exactly works. If no FORUM_ID / TOPIC_ID is known then it will be shown by the last ELSE-branch.

I hope I finally could help to solve the problem(s) ...
atoirtap
Registered User
Posts: 63
Joined: Thu Aug 01, 2013 8:34 pm

Re: IF variable for forum id?

Post by atoirtap »

Ho, ho, ho! Now it works! Thank you santa regazer :mrgreen:
regazer
Registered User
Posts: 69
Joined: Sun Sep 08, 2013 7:11 pm
Name: Reginald Gazer

Re: IF variable for forum id?

Post by regazer »

Thank you santa regazer
you got me :oops:
I'll do what I'm able to. :lol:
User avatar
ViolaF
I've Been Banned!
Posts: 1609
Joined: Tue Aug 14, 2012 11:52 pm

Re: IF variable for forum id?

Post by ViolaF »

Thats the only thing which really works. A Forun Link is just a forum id, so enter it as given here and all work fine
regazer wrote:Oh guys and girls, I think found it. The file forumlist_body.html was right.

BUT is hasn't to be only "FORUM_ID". It has to be "forumrow.FORUM_ID" :lol:

Maybe that in older versions only FORUM_ID had been enough.

in the file forumlist_body.html:

Code: Select all

<!-- IF forumrow.FORUM_ID eq '2' --><a href="link2">2</a>
<!-- ELSEIF forumrow.FORUM_ID eq '3' --><a href="link3">3</a>
<!-- ELSEIF forumrow.FORUM_ID eq '4' --><a href="link4">4</a>
<!-- ELSE -->forumrow.FORUM_ID = {forumrow.FORUM_ID}
<!-- ENDIF -->
To do the same with topics it has to look something like this (in the file viewforum_body.html) :

Code: Select all

<!-- IF topicrow.TOPIC_ID eq '2' --><a href="link2">2</a>
<!-- ELSEIF topicrow.TOPIC_ID eq '3' --><a href="link3">3</a>
<!-- ELSEIF topicrow.TOPIC_ID eq '4' --><a href="link4">4</a>
<!-- ELSE -->topicrow.TOPIC_ID = {topicrow.TOPIC_ID}
<!-- ENDIF -->
I renamed something to show how it exactly works. If no FORUM_ID / TOPIC_ID is known then it will be shown by the last ELSE-branch.

I hope I finally could help to solve the problem(s) ...
User avatar
ViolaF
I've Been Banned!
Posts: 1609
Joined: Tue Aug 14, 2012 11:52 pm

Re: IF variable for forum id?

Post by ViolaF »

A Forum Link < was an error.

but i see now it worked for you
regazer
Registered User
Posts: 69
Joined: Sun Sep 08, 2013 7:11 pm
Name: Reginald Gazer

Re: IF variable for forum id?

Post by regazer »

A Forum Link < was an error.
:roll:

What did you mean? If you meant your typo in your post before or what else - why didn't you edit your post instead of writing a new one ? It seems to become off topic already it's solved. :lol:
User avatar
ViolaF
I've Been Banned!
Posts: 1609
Joined: Tue Aug 14, 2012 11:52 pm

Re: IF variable for forum id?

Post by ViolaF »

yes, a typo, i saw the solution-post to late after sending my post :oops:
and i cant edit any post of mine...

Return to “[3.0.x] MOD Writers Discussion”