Log in

View Full Version : Trying to create $forum['subscribed'] conditional


kyrnel
04-13-2004, 03:57 AM
Like the title says..
If I can create a conditional that indicates whether a forum is subscribed to, then I can add an indicator on ForumHome that alloows a user to subscribe/unsubscribe.

I tried adding this code to functions_forumlist.php:
// %%%%%%%%%%%%%%%%%%%% added code for forum subscriptions %%%%%%%%%%%%%%%%%%%%

$xquery = "SELECT subscribeforumid FROM " . TABLE_PREFIX . "forum AS forum

LEFT JOIN " . TABLE_PREFIX . "subscribeforum AS subscribeforum ON ((subscribeforum.forumid =

forum.forumid) AND (subscribeforum.userid = $bbuserinfo[userid]))";

$forum['subscribed'] = false;

$xsubscriptions = $DB_site->query($xquery);

if ($DB_site->num_rows($xsubscriptions))

{

while ($xsub = $DB_site->fetch_array($xsubscriptions))

{

if ($xsub(subscribeforumid) = $forum[forumid])

{

$forum['subscribed'] = true;

}

}

}

// %%%%%%%%%%%%%%%%% ENd added %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

But it doesnt seem to work, I get a parse error on the 'while' statement.
Anyone have a sugeestions or alternative approaches, I'd appreciate it.

Thx

kyrnel
04-15-2004, 07:15 PM
Any one?

I would expect that many people would like to be able to show indicators of forum subscriptions just like it displays indicators of thread subscriptions..

kyrnel
05-10-2004, 03:49 PM
No one is interested in this mod?

assassingod
05-10-2004, 03:52 PM
Isn't it meant to be

if ($xsub[subscribeforumid] = $forum[forumid])


instead of

if ($xsub(subscribeforumid) = $forum[forumid])

?

kyrnel
05-10-2004, 04:40 PM
*bonk*
testing it now....hopefully that's all that was wrong.

kyrnel
05-10-2004, 06:44 PM
Nope, that helped but it still is a context issue. I actually figured out a MUCH simpler way to accomplish this.

I am making into a hack right now. It only required one minor change to the code.
I will post it soon.

kyrnel
05-10-2004, 09:54 PM
Here is the link to the hack to do this:

https://vborg.vbsupport.ru/showthread.php?t=64974

My first real hack. Enjoy!