vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Trying to create $forum['subscribed'] conditional (https://vborg.vbsupport.ru/showthread.php?t=63807)

kyrnel 04-13-2004 03:57 AM

Trying to create $forum['subscribed'] conditional
 
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:
PHP Code:

// %%%%%%%%%%%%%%%%%%%% 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
PHP Code:

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

instead of
PHP Code:

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!


All times are GMT. The time now is 06:39 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01114 seconds
  • Memory Usage 1,728KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete