Jump to content

mysql query to show social links on knowledgebase articles


Nullified

Recommended Posts

I have placed the {if $googleplus1}{if $twittertweet}{if $facebookcomments}{if $facebookrecommend} statements within the knowledgebaseartcile.tpl so I can show the social media share links on knowegebase article as well, but the checks to see if they are enabled are not coded into knowledgebase.php as they are announcements.php. I am wondering if someone can provide me with the same sql query / php code that will allow the if statements to do their job. Or at least the sql table that contains this info.

Link to comment
Share on other sites

I found the table and developed the sql:

$results = mysql_query("SELECT setting, value FROM tblconfiguration WHERE setting IN ('AnnouncementsTweet', 'AnnouncementsFBRecommend', 'AnnouncementsFBComments', 'GooglePlus1')");
while ($result = mysql_fetch_assoc($results)) {if ($result['value'] == "on") {$social[$result[setting]] = true;}}
if ($social['GooglePlus1']) {$this->_tpl_vars['googleplus1'] = true;}
if ($social['AnnouncementsTweet']) {$this->_tpl_vars['twittertweet'] = true;}
if ($social['AnnouncementsFBComments']) {$this->_tpl_vars['facebookcomments'] = true;}
if ($social['AnnouncementsFBRecommend']) {$this->_tpl_vars['facebookrecommend'] = true;}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated