The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
[CMS] Add thread link to article preview
Hi,
In vB4 CMS, in order to reach the promoted forum posts we have to open the article and click on the tiny url at the end of each article (vbcms_content_article_page): I would like have the same thing in my article preview (cms home page) for each of the articles. I found the codes in template "vbcms_content_article_page" which is for this part of articles. PHP Code:
vb:link thread vb:raw threadinfo vb:link member vb:raw poststarter vb:raw post_url These variables are not accessible from "vbcms_content_article_preview" template. However I only need vb:raw post_url to get the url and $promoted_threadid to get the condition. This is what I get in CMS home page (vbcms_content_article_preview): I really need to have thread links in article preview in my CMS. I would appreciate your help. thanks in advance, |
#2
|
||||
|
||||
You need a plugin to get the thread id, I believe. Something like (at vbcsm_article_populate_end):
PHP Code:
|
#3
|
|||
|
|||
Quote:
Thanks! |
#4
|
|||
|
|||
Thanks a lot Lynne for your answer,
When I add this as a plugin in hook location vbcms_article_populate_end i get the following db error: Quote:
Execution Order: 5 I appreciate if you tell me the correct way to do this. |
#5
|
||||
|
||||
Then add the prefix in front of the other table name also:
PHP Code:
|
#6
|
|||
|
|||
I successfully created the plugin after adding another prefix for cms_node.
This will be the correct codes which I used: PHP Code:
I truly appreciate your help Lynne. regards, |
Благодарность от: | ||
Phoebes |
#7
|
|||
|
|||
I was looking to do this same thing.
I followed what you did here and I can get it to link to the correct post by using something like: Code:
<a href="showthread.php?{vb:raw threadid}">{vb:raw title}</a> Instead of the link looking like ...showthread.php?37. it would look like ...showthread.php?37-title-text-here |
#8
|
||||
|
||||
There is an article on writing the friendly urls correctly here - vBulletin 4 Template Syntax: Links
|
#9
|
|||
|
|||
Thanks for the link Lynne, but It's not working for me still.
Is Code:
$record = vB::$vbulletin->db->query_first("SELECT a.threadid FROM " . TABLE_PREFIX . "cms_article AS a JOIN " . TABLE_PREFIX . "cms_node ON(" . TABLE_PREFIX . "cms_node.contentid = a.contentid) WHERE nodeid = " . $this->getNodeId()); $view->threadid = $record['threadid']; enough to give the vbcms_content_article_preview template access to the title information? The only thing I can generate is the thread id. Is there another query I need to add to get the title? If so, I'm not sure of the syntax for that. |
#10
|
||||
|
||||
Thanks for Lynne, I also have problems with friendly urls, hope you can help me complete
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|