PDA

View Full Version : links on forumhome if user is logged in???


Birdie501
06-07-2002, 10:29 PM
How can i set links which are stored in a template to be shown on forumhome if the user is logged in? If he is a guest or not looged in it should not be shown!

I made a template called forumhomelinks with that code:

<a href="newthread.php?s=&forumid=$forum[forumid]"><img src="https://vborg.vbsupport.ru/images/newthread2.gif" border="0" alt="Neues Thema im Forum $forum[title] erstellen"></a>
<a href="member2.php?s=&action=addsubscription&forumid=$forum[forumid]"><img src="https://vborg.vbsupport.ru/images/subscribe2.gif" border="0" alt="Das Forum $forum[title] abonnieren und ?ber neue Nachrichten informiert werden"></a>
<a href="search.php?s=$session[sessionhash]&action=getnew&forumid=$forum[forumid]"><img src="https://vborg.vbsupport.ru/images/findnew.gif" border="0" alt="Die neuesten Themen in diesem Forum seit Deinem letzten Besuch auflisten"></a>


then i tried to add this code to index.php

if ($bbuserinfo['userid']==0) {
$forumhomelinks ="";
} else {
eval("\$forumhomelinks = \"".gettemplate('forumhomelinks')."\";");
}


but it doesn?t work.

What do I have to change?

Thanks in advance.

Admin
06-08-2002, 05:36 AM
Where have you added that code, and did you add $forumhomelinks to youro forumhome template?

Birdie501
06-08-2002, 09:08 AM
hi Firefly,

i tried several things. I added that code to index.php, global.php, to template phpinclude. And i also added the variable $forumhomelinks to template forumhome_forumbit_level2_post
????

Admin
06-08-2002, 11:17 AM
Globalize $forumhomelinks in the makeforumbit() function.

Birdie501
06-08-2002, 12:03 PM
i added $forumhomelinks in forumdisplay.php to the global variables but it still doesn`t work. Can you tell exactly what i should do?

Admin
06-08-2002, 02:46 PM
Replace this:
function makeforumbit($forumid,$depth=1,$permissions='') {
global $DB_site,$bbuserinfo,$iforumcache,$ipermcache,$imo dcache,$session,$accesscache,$usergroupdef,$noperm s;
With this:
function makeforumbit($forumid,$depth=1,$permissions='') {
global $DB_site,$bbuserinfo,$iforumcache,$ipermcache,$imo dcache,$session,$accesscache,$usergroupdef,$noperm s,$forumhomelinks;

Birdie501
06-09-2002, 02:46 PM
OK!
I did:
1) added the code from my first post to index.php
2) made a new template with the code from my first post and saved as forumhomelinks
3) added $forumhomelinks to template forumhome_forumbit_level2_post
4) added $forumhomelinks to forumdisplay.php at the place you wrote in the post above.

i want to show the links in forumhome on the index page!

What else can i do?

Birdie501
06-12-2002, 12:26 AM
Please help :-) Thanks!

Xenon
06-12-2002, 01:26 PM
hmm, try that:
put the code if ($bbuserinfo['userid']==0) {
$forumhomelinks ="";
} else {
eval("\$forumhomelinks = \"".gettemplate('forumhomelinks')."\";");
}

direct before that

eval("\$forumbits .= \"".gettemplate("forumhome_forumbit_level$depth$tempext")."\";");

Birdie501
06-12-2002, 03:53 PM
Hi Xenon,

you're the best! :-) It works!
Thaaaaaaaaannnnnkkkkkkssss!

Xenon
06-12-2002, 07:35 PM
You're welcome :)

:)
Bitte, keine ursache, wobeis auch sch?n ist mal was zu wissen wo chen gescheitert ist ;)