Link to forums from article/news
mishima 144
From: -
From: -
Notice
This topic is archived. New comments cannot be posted and votes cannot be cast.Responses to this topic
1 Re: Link to forums from article/news
Philipp
From: Vienna, Austria
Administrator
1340From: Vienna, Austria
PHP part:
HTML part:
global $database;
$result = $database -> dbquery( "SELECT articlecat_name, articlecat_seo FROM " . DB_PREFIX . "esselbach_ct_articlescats WHERE articlecat_id = '" . $insert['article_category'] . "'" );
list( $insert['article_category'], $insert['article_category_seo'] ) = $database -> dbrow( $result );
HTML part:
<a href="https://www.contentteller.com/index.php{$insert['param_ct']}articles{$insert['param_action']}categories{$insert['param_page']}{$insert['article_category_seo']}.html">{$insert['article_category']}</a>
1 Re: Link to forums from article/news
mishima
OP
144
From: -
From: -
Thanks that works great Philipp. Just one thing, I wanted it to be a hyperlink and go to that category on the site. I had a think about how this may work but couldn't figure it out. I imagine it really isn't hard!! How would I do this?
1 Re: Link to forums from article/news
Philipp
From: Vienna, Austria
Administrator
1340From: Vienna, Austria
You need to add the following PHP part to the articles_pages template:
Then you can use {$insert['article_category']} in the HTML part
global $database;
$result = $database -> dbquery( "SELECT articlecat_name FROM " . DB_PREFIX . "esselbach_ct_articlescats WHERE articlecat_id = '" . $insert['article_category'] . "'" );
list( $insert['article_category'] ) = $database -> dbrow( $result );
Then you can use {$insert['article_category']} in the HTML part
1 Re: Link to forums from article/news
mishima
OP
144
From: -
From: -
Just one other thing - how can I add the category that the article is in onto this area too please?
1 Re: Link to forums from article/news
mishima
OP
144
From: -
From: -
Thanks!
1 Re: Link to forums from article/news
Philipp Esselbach
From: -
Editor
0From: -
You need to edit the templates news_story and news_story_extended
Add the following in the PHP part:
Then you can use the variable $forum_link, which contains the link to the forum in the HTML part. For example:
For the articles module you need to edit the templates articles_summary and articles_pages.
The PHP part is slightly different:
Then you can use the same HTML part in the templates:
Add the following in the PHP part:
global $uwrapper;
$forum_link = $uwrapper -> getthreadlink( $insert[ 'newsstory_thread' ] );
Then you can use the variable $forum_link, which contains the link to the forum in the HTML part. For example:
<a href="https://www.contentteller.com/{$forum_link}">Discuss in forum</a>
For the articles module you need to edit the templates articles_summary and articles_pages.
The PHP part is slightly different:
global $uwrapper;
$forum_link = $uwrapper -> getthreadlink( $insert[ 'article_thread' ] );
Then you can use the same HTML part in the templates:
<a href="https://www.contentteller.com/{$forum_link}">Discuss in forum</a>
Hello,
I would like to add a link next to the "comments" at the top of news/articles so that users can go straight to the coresponding thread on the forums. How can I do this?
Thanks