Mind blowing SEO improving and Google rank increasing Signature Rotator SEO Tool.

Thread: 

show subscription link for each forum in Index

Ads
banner
banner
banner
lion Offline referral

Posts: 122
Joined: May 2014
Reputation: 0

#1
Member
Hello
How can I show subscription link for each forum in Index in mybb ?

I used this code :
Code:
<a href="usercp2.php?action={$add_remove_subscription}subscription&amp;type=forum&amp;fid={$forum['fid']}&amp;my_post_key={$mybb->post_code}">subscribe</a>

but didn't work
Would you help me ?

Heart
marcus_avrelius Offline referral

Posts: 2,424
Joined: May 2013
Reputation: 102

#2
Support Team
Gonna need core modification or a plugin to fetch forum FID and generate post key! Will take a look at it later gotta go build some muscle.
Looking for ways to make money fast? Read this article and start earning money todya fast, easy or for free.
marcus_avrelius Offline referral

Posts: 2,424
Joined: May 2013
Reputation: 102

#3
Support Team
Here is a plugin for you that shows subscription options for each forum in index home page.

Add this link to forumbit_depth2_forum template!
PHP Code:
<a href="usercp2.php?action={$forum['add_remove_subscription']}subscription&amp;type=forum&amp;fid={$forum['fid']}&amp;my_post_key={$mybb->post_code}">{$forum['add_remove_subscription_text']}</a

And here is a plugin to make it work.
PHP Code:
<?php
if(!defined("IN_MYBB"))
{
    die(
"Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
}

$plugins->add_hook("build_forumbits_forum""forum_subscribtion");

function 
forumsubscription_info()
{
    return array(
        
"name"            => "Forum Subscription",
        
"description"    => "Shows forum subscription option on home page. Users can subscribe and unsubscribe to an individual forum from the home page.",
        
"website"        =>"http://letsforum.com/Thread-show-subscription-link-for-each-forum-in-Index",
        
"author"        => "LetsForum",
        
"authorsite"    => "http://letsforum.com",
        
"version"        => "1.0",
        
"compatibility" => "*"
    
);
}


function 
forum_subscribtion(&$forum)
{
    global 
$mybb$db;

// Subscription status

$forum['add_remove_subscription'] = "add";
$forum['add_remove_subscription_text'] = "Subscribe to this forum";

    
$query $db->simple_select("forumsubscriptions""fid""fid='".$forum['fid']."' AND 

uid='
{$mybb->user['uid']}'", array('limit' => 1));

    if(
$db->fetch_field($query'fid'))
    {
        
$forum['add_remove_subscription'] = 'remove';
        
$forum['add_remove_subscription_text'] = 'Unsubscribe to this forum';
    }
}
?>

Don't forget to activate this bad boy Smile
Looking for ways to make money fast? Read this article and start earning money todya fast, easy or for free.
lion Offline referral

Posts: 122
Joined: May 2014
Reputation: 0

#4
Member
wow 001_tt1
Thanks a lot Dear Victor HeartHeart





User(s) browsing this thread: 1 Guest(s)