Best of joomla gives you news, joomla templates, tutorials and websites about Joomla , FireBoard and FireMessage official page.
| No account yet?   |
The FireBoard forum component development is still going on. In order to get better, FireBoard will be moved from the Best of Joomla website.
During this transition period, the forum in Best of Joomla will be closed to new posts.
Welcome, Guest
Please Login or Register.    Lost Password?
FireBoard Manual Latest release discussions Download FireBoard
Subscribe to forum instead of thread (1 viewing) (1) Guest
TOPIC: Subscribe to forum instead of thread
#59426
Re:Subscribe to forum instead of thread 3 Months, 1 Week ago  
How did you get on with this on 1.0.5 ?

I have a problem after applying this hack, for some reason I get the error -

Could not instantiate mail function.

Any idea's?
bruce.taylor (User)
Fresh Boarder
Posts: 4
graphgraph
User Offline Click here to see the profile of this user
Logged Logged
 
 
#60055
Re:Subscribe to forum instead of thread 3 Months ago  
I just tried to make this hack work with v.1.0.5RC2, but I got the following error in a page which is partly shown and without any layout:
Fatal error: Cannot use object of type fb_Config as array in /home/myaccount/public_html/mydomain.eu/components/com_fireboard/template/default_ex/showcat.php on line 304

This refers to the following bit of code:
Code:

//Start Hack by SBS 

if ($fbConfig['allowsubscriptions'] == 1 && ("" != $my_id || 0 != $my_id))



Frankly I have no idea what this means or what to do about it

BTW I am using default_ex. So I changed showcat in the default_ex folder but the other two files in the default template folder.
ewel (User)
Junior Boarder
Posts: 61
graphgraph
User Offline Click here to see the profile of this user
Logged Logged
 
Last Edit: 2008/10/10 02:36 By ewel.
 
 
#60059
Re:Subscribe to forum instead of thread 3 Months ago  
Looks like they've changed how they store that variable.

I think I read someplace they are moving towards holding configuration in the db rather than a text file. (Makes upgrades safer).

I'll need to find out how they call the variable now. 'fraid that'll take me a little time as busy with other stuff right now...
polc1410 (User)
Junior Boarder
Posts: 65
graphgraph
User Offline Click here to see the profile of this user
Logged Logged
 
 
#60070
Re:Subscribe to forum instead of thread 3 Months ago  
You are right, and I had downloaded and run that conversion utility they have to put settings in the databaae in order to go from v104 to v105. I'm not in a hurry but I would like to have this!

Actually what I would really want is that all CB users are automatically subscribed to all of the forums. With a small number of members visiting infrequently to read few posts this is a must to make the forum work as a community tool.
ewel (User)
Junior Boarder
Posts: 61
graphgraph
User Offline Click here to see the profile of this user
Logged Logged
 
 
#60119
Re:Subscribe to forum instead of thread 3 Months ago  
Kind of thinking aloud here, but since you are putting the hack in - you must want subscription so the if statement is not really needed (the if statement is simply checking if subscribe is enabled) Maybe try:

Code:


//Start Hack by SBS 

if  ("" != $my_id || 0 != $my_id) {


instead.

As for CB... you'd need to write some code for that.

I work with a component called AEC which could do it by running a micro-intergation to add them to the table on signup. I think someone was talking of a CB plugin to do simillar etc but never seen one.
polc1410 (User)
Junior Boarder
Posts: 65
graphgraph
User Offline Click here to see the profile of this user
Logged Logged
 
 
#60126
Re:Subscribe to forum instead of thread 3 Months ago  
I just searched the FB files for the configuration, and found out that (if I understand it correctly) there is a file fb_config.class.php with a class fb_Config which holds a variable $allowsubscriptions.

So I went back to the hacked showcat.php and changed fbconfig into fb_config and now the error is gone!

However, I now have a new error in making a new post:
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/aapje06/public_html/nbnm.eu/components/com_fireboard/template/default/post.php on line 1261

The code on that line is this:
Code:

1259 $resubject = preg_replace("/'/", ''', $resubject);
1260
1261 $resubject = preg_replace("/"/", '"', $resubject);
1262
1263 //$table = array_flip(get_html_translation_table(HTML_ENTITIES));



I can see in the code higlighting that something is wrong, and if I remove the ' in line 1259 the code highlighting is back to normal, the error is gone and the page loads normally.

However I think the price to pay is that the ' sign now is not filtered out from post subjects which I assume might lead to errors.

Having come this far I have to say I am not seeing any sign of an option to subscribe to the forum instead of the thread. What am I supposed to find if the hack works?
ewel (User)
Junior Boarder
Posts: 61
graphgraph
User Offline Click here to see the profile of this user
Logged Logged
 
 
#60133
Re:Subscribe to forum instead of thread 3 Months ago  
I got it to work with FB 1.0.5 RC2 ! To get it to work I had to make some changes to the hack as it was by looking at how the FB code has changed, but in the end it worked out. I'll post the snippets of code in a next post in this thread to keep this post clean.

Now I am interested to see if and how I can get the FB CB plugin to work like the one posted by phleum on page 9 above so that users can see and change their category subscriptions in a tab in their profile.

I also saw and downloaded fb_autosubscribe module of freakshowtm posted on page 9 above. I don't think I will use it because it will autosubscribe everyone every time they visit a page where the module is placed.
However it inspired me to think that the solution would be to place something in the Community Builder registration process that will autosubscribe new users. So I am going to investigate how that could be done.
ewel (User)
Junior Boarder
Posts: 61
graphgraph
User Offline Click here to see the profile of this user
Logged Logged
 
 
#60135
Re:Subscribe to forum instead of thread 3 Months ago  
For FB 1.0.5 RC2:

In showcat.php after the following:
Code:

                    //this user is allowed to post a new topic:
                    echo fb_link::GetPostNewTopicLink($catid, $fbIcons['new_topic'] ? '<img src="' . JB_URLICONSPATH . '' . $fbIcons['new_topic'] . '" alt="' . _GEN_POST_NEW_TOPIC . '" title="' . _GEN_POST_NEW_TOPIC . '" border="0" />' : _GEN_POST_NEW_TOPIC);
                }


as well as after the following (so that the button appears above as well as below):
Code:

                    //this user is allowed to post a new topic:
                    echo fb_link::GetPostNewTopicLink($catid, $fbIcons['new_topic'] ? '<img src="' . JB_URLICONSPATH . '' . $fbIcons['new_topic'] . '" alt="' . _GEN_POST_NEW_TOPIC . '" title="' . _GEN_POST_NEW_TOPIC . '" border="0" />' : _GEN_POST_NEW_TOPIC);
                }


insert this:
Code:

//Start Hack by SBS 
                  
                    if ($fbConfig->allowsubscriptions == 1 && ("" != $my_id || 0 != $my_id))
                    {
                        //$fb_thread==0 ? $check_thread=$catid : $check_thread=$fb_thread;
                        $database->setQuery("SELECT category from #__fb_subscriptions where userid='$my_id' and category='$catid'");
                        $fb_subscribed = $database->loadResult();

                        if ($fb_subscribed == "") {
                            $fb_cansubscribe = 1;
                        }
                        else {
                            $fb_cansubscribe = 0;
                        }
                    }

                    if ($my_id != 0 && $fbConfig->allowsubscriptions == 1 && $fb_cansubscribe == 1)
                    {
                    echo '<a href ="'.sefRelToAbs(JB_LIVEURLREL.'&func=post&do=subscribe&fb_thread=0&catid='.$catid.'&id='.$id).'" >';
                    echo $fbIcons['subscribe'] ? '<img src="' . JB_URLICONSPATH . '' . $fbIcons['subscribe'] . '" border="0" title="' . _VIEW_SUBSCRIBETXT . '" alt="' . _VIEW_SUBSCRIBETXT . '" />' : _VIEW_SUBSCRIBE;
                    echo "</a>";
                    }

                    if ($my_id != 0 && $fbConfig->allowsubscriptions == 1 && $fb_cansubscribe == 0)
                    {
                    echo '<a href = "'.sefRelToAbs(JB_LIVEURLREL.'&func=myprofile&do=unsubscribeitem&catid='.$catid).'" >';
                    echo $fbIcons['unsubscribe'] ? '<img src="' . JB_URLICONSPATH . '' . $fbIcons['unsubscribe'] . '" border="0" title="' . _VIEW_UNSUBSCRIBETXT . '" alt="' . _VIEW_UNSUBSCRIBETXT . '" />' : _VIEW_UNSUBSCRIBE;
                    echo "</a>";
     }
    
//End Hack by SBS 



In post.php, after the following:
Code:

//Now manage the subscriptions (only if subscriptions are allowed)
if ($fbConfig->allowsubscriptions == 1)
{ //they're allowed
//get the proper user credentials for each subscription to this topic
//clean up the message
$mailmessage = smile::purify($message);


change into this:
Code:

//Query Hacked By ShinyBlackShoe to allow category subscribe 
$database->setQuery("SELECT DISTINCT * FROM #__fb_subscriptions AS a"
     . "n LEFT JOIN #__users as u ON a.userid=u.id "
     . "n WHERE a.thread= {$querythread} OR a.category='$catid'");
// 



and after the following:
Code:

$resubject = base64_decode(strtr($resubject, "()", "+/"));
$resubject = str_replace("%20", " ", $resubject);
$resubject = preg_replace('/%32/', '&', $resubject);
$resubject = preg_replace('/%33/', ';', $resubject);


change into this:
Code:

//REMOVED BECAUSE OF ERROR AFTER HACK 
                    //$resubject = preg_replace("/'/", ''', $resubject);



and after the following:
Code:

//check for permission
if (!$is_Moderator) {
if ($fbSession->allowed != "na")
$allow_forum = explode(',', $fbSession->allowed);
else
$allow_forum = array ();
$obj_fb_cat = new jbCategory($database, $row->catid);
if (!fb_has_read_permission($obj_fb_cat, $allow_forum, $aro_group->group_id, $acl)) {
echo "Hacking Attempt!";
return;
}
}
$thread = $row->thread;


change into this:
Code:

//Start Hack By ShinyBlackShoe to allow category subscribe 
if ($fb_thread == "0"){  //sub cat instead of thread
$database->setQuery("INSERT INTO #__fb_subscriptions (category,userid) VALUES ('$catid','$my->id')");
}
else {
//End Hack by SBS 
                        $database->setQuery("INSERT INTO #__fb_subscriptions (thread,userid) VALUES ('$thread','$my->id')");
//Start Hack By ShinyBlackShoe to allow category subscribe 
}
//End Hack by SBS 



I do not use FB profiles so I don't know if the following works, but according to the original hack, in userprofile.php after the following:
Code:

    <?php

    }

    else if ($do == "unsubscribe")

    { //ergo, ergo delete


put this:
Code:

//Start Hack by ShinyBlackShoe to give forum subscribe 
    if ($thread == "0"){ //unsub from cat not thread
        $database->setQuery("DELETE from #__fb_subscriptions where userid=$my->id and category=$catid");
    }
    else {
        $database->setQuery("DELETE from #__fb_subscriptions where userid=$my->id and thread=$thread");
    }
//End hack by SBS 

ewel (User)
Junior Boarder
Posts: 61
graphgraph
User Offline Click here to see the profile of this user
Logged Logged
 
Last Edit: 2008/10/11 13:34 By ewel.
 
 
#60397
Re:Subscribe to forum instead of thread 2 Months, 3 Weeks ago  
Hi,
Thanks for this. The autosubscribe as such seems to work well in my environment (J1.5.7, FB 1.0.5 RC2) as the jos_fb_subscriptions table gets populated fine and the categories show up in the CB user profile as well.
However, there was a difference in the latest post.php file and I obtain an error upon submitting a post (and nobody gets notified).

in post.php, lines 631ff reads:

$resubject = base64_decode(strtr($resubject, "()", "+/");
$resubject = str_replace("%20", " ", $resubject);
$resubject = preg_replace('/%32/', '&', $resubject);
$resubject = preg_replace('/%33/', ';', $resubject);
$resubject = preg_replace("/'/", '&#039;', $resubject);
$resubject = preg_replace("/"/", '&quot;', $resubject);

so there was no $resubject = preg_replace("/'/", ''', $resubject); to comment out, as suggested in the post above.


The error I get is (and it throws the template):

Fatal error: Unable to load subscriptions.nDB function failed with error number 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'n WHERE a.thread= 443 OR a.category='2'' at line 1 SQL=SELECT DISTINCT * FROM jos_fb_subscriptions AS an LEFT JOIN jos_users as u ON a.userid=u.id n WHERE a.thread= 443 OR a.category='2'
SQL =

SELECT DISTINCT * FROM jos_fb_subscriptions AS an LEFT JOIN jos_users as u ON a.userid=u.id n WHERE a.thread= 443 OR a.category='2'

in .../components/com_fireboard/sources/fb_debug.php on line 37


The server is on MySQL 5.0.67-community; I restored from a JoomlaPack 1.2.2.b2 backup, my localhost is on 5.0.51b-community-nt (Wampserver). The whole thing worked fine with FB 1.0.4.

Can someone help please?
BW, Erik (ejw)



EDIT:
I have of course commented out $resubject = preg_replace("/'/", '&#039;', $resubject);
but the error remains
ejw (User)
Fresh Boarder
Posts: 5
graphgraph
User Offline Click here to see the profile of this user
Logged Logged
 
Last Edit: 2008/10/17 15:21 By ejw. Reason: further info
 
 
#60403
Re:Subscribe to forum instead of thread 2 Months, 3 Weeks ago  
Erik, could it be that you have forgotten to change the database? For how to do that see the many posts about that in the earlier pages in this thread as well as http://www.wittongilbert.free-online.co.uk/FBHack/HowTo.html.
ewel (User)
Junior Boarder
Posts: 61
graphgraph
User Offline Click here to see the profile of this user
Logged Logged
 
 
Go to top