Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 01-14-2012, 06:38 AM
Webbstre Webbstre is offline
 
Join Date: Nov 2009
Posts: 175
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Need some advice on CMS Article + Forum Comment Threads

Ok, here's my situation. For the past year and a half I've been using Use Original Thread for Comments to have a merged set of comments between my cms articles and their duplicates within my forums. I have two sets of news sub-forums (one for my site's news and one for the news of the games we cover).

If anyone knows how to make any of these options work, it'll make life much easier for me!

The problem is simple: I'm tired of having to make duplicate posts (via Promote to Article) for every news article. I'm tired of having to maintain two posts for every correction or typo or update that comes up. Yet I still want the convenience for my users to be able to view news from the forums, as many of them stick around in the forums.

I'm thinking about trying to make things simpler, in one of three ways:

1- Installing a new modification that will either make articles that will automatically make the appropriate "copy" comments thread in the forum it should be in (or if posted in the forums first, make the copy of the first post in the correct article section). I thought I had something with Article Forums, but that makes a different content type, not CMS articles. The problem here is I can't find a modification that actually does this.

2- Merge my two News Sub-forums, make it the default CMS Comments forum (and just accept that the first post won't look like the article and just be a link to the article), and Prefix the comments posts somehow so that it's obvious to users what kind of article it is. The problem here is that I can't find a way to merge two long-existing forums into one.

3- Make one of my news forums the default CMS Comments forum, and just manually move the comments thread whenever I have to post site news. The problem here is that if a comment thread is moved you become unable to see comment updates from the CMS section (though you can see it from within the forum).

--------------- Added [DATE]1326597356[/DATE] at [TIME]1326597356[/TIME] ---------------

Ok, I have an update on this with how I solved most of my problem, and just wanted to share, as well as ask for help on something hopefully simpler.

First, I found my solution in Number 2, listed above. I discovered that you can Mass Move Threads via the Admin panel, or in the admincp under Threads and Posts > Move. I solved my prefix problem by using Change Threads' Prefixes Inline, which requires one minor hook location edit to make work, but that's easy to do. I added prefixes to my news forum threads en mass, and then mass moved them all over. Then I changed my CMS Comments forum to point at my news forum. Now I only need to make a news post via the CMS, and it automatically makes the thread in my news forum. I just have to manually add a prefix to the comments thread, but that's easy enough.

Now I want to do two more things to make this perfect.
1- Stop the word "Article:" from appearing at the beginning of every comments thread.
2- Include a limited preview of the article within the first post of the comments thread. I see there's a way to make the full post show up (in a slightly limited manner) via Lynne's post here, but I really only want it to show the preview of the article, similar to the CMS homepage. It wouldn't need to have the thumbnails made though.
Reply With Quote
  #2  
Old 01-16-2012, 11:27 AM
Webbstre Webbstre is offline
 
Join Date: Nov 2009
Posts: 175
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Edit: I bumped it, then found the answer to half my problem! Here is how to remove or change the "Article:" from all CMS Comment Threads:

1- Go into admincp
2- Go to Languages and Phrases > Search in Phrases
3- Search for the word "Article:" (Without the quotes)
4- You should see "comment_thread_title" near the top
5- Edit it from saying "Article: {1}" to just "{1}" for all languages
6- You're done! This won't change any past comment threads though.

Now to just figure out how to make that first post show a preview of the article (but not the whole article)
Reply With Quote
  #3  
Old 01-16-2012, 05:03 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Use My post here and grab cms_article.previewtext instead of the pagetext.
Reply With Quote
  #4  
Old 01-17-2012, 12:09 PM
Webbstre Webbstre is offline
 
Join Date: Nov 2009
Posts: 175
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the response Lynne! Unfortunately I'm not having any luck with it I get the asterisks, but nothing below it. I tried turning cms_article.pagetext to cms_article.previewtext, and tested a post, then tried changing all instances of pagetext to previewtext, but in every case I end up with an empty comments thread post below the asterisks.

...I know you said you're not providing support beyond the initial post, so should I go elsewhere for help? :/
Reply With Quote
  #5  
Old 01-17-2012, 11:04 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What is your exact plugin code right now after the changes?
Reply With Quote
  #6  
Old 01-18-2012, 12:12 PM
Webbstre Webbstre is offline
 
Join Date: Nov 2009
Posts: 175
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, here's what I've tried so far:

My first try, I used this:
Code:
if (THIS_SCRIPT == 'showthread' AND $this->thread['forumid'] == $this->registry->options['vbcmsforumid'] AND $this->post['postcount'] == 1) {

$result = $this->registry->db->query_first("
    SELECT cms_article.previewtext, cms_article.threadid, cms_article.htmlstate 
    FROM " . TABLE_PREFIX . "cms_article AS cms_article 
    INNER JOIN " . TABLE_PREFIX . "cms_node AS cms_node ON (cms_node.contentid = cms_article.contentid) 
    INNER JOIN " . TABLE_PREFIX . "cms_nodeinfo AS cms_nodeinfo ON (cms_nodeinfo.nodeid = cms_node.nodeid) 
    WHERE cms_nodeinfo.associatedthreadid = ". $this->thread['threadid']. "
        ");

$bbcode_parser = new vBCms_BBCode_HTML(vB::$vbulletin,  vBCms_BBCode_HTML::fetchCmsTags());

$pagetext = fetch_censored_text($bbcode_parser->do_parse($result['pagetext'],true,$result['htmlstate']));

$find = 'type="submit"';
$replace = 'type="submit" disabled';
$pagetext = str_replace ($find, $replace, $pagetext);

$result['previewtext'] = $pagetext;
$this->post['message'] .= '<br />*********<br />'. $result['previewtext'];
}
Then I tried changing all instances of pagetext to previewtext:
Code:
if (THIS_SCRIPT == 'showthread' AND $this->thread['forumid'] == $this->registry->options['vbcmsforumid'] AND $this->post['postcount'] == 1) {

$result = $this->registry->db->query_first("
    SELECT cms_article.previewtext, cms_article.threadid, cms_article.htmlstate 
    FROM " . TABLE_PREFIX . "cms_article AS cms_article 
    INNER JOIN " . TABLE_PREFIX . "cms_node AS cms_node ON (cms_node.contentid = cms_article.contentid) 
    INNER JOIN " . TABLE_PREFIX . "cms_nodeinfo AS cms_nodeinfo ON (cms_nodeinfo.nodeid = cms_node.nodeid) 
    WHERE cms_nodeinfo.associatedthreadid = ". $this->thread['threadid']. "
        ");

$bbcode_parser = new vBCms_BBCode_HTML(vB::$vbulletin,  vBCms_BBCode_HTML::fetchCmsTags());

$previewtext = fetch_censored_text($bbcode_parser->do_parse($result['previewtext'],true,$result['htmlstate']));

$find = 'type="submit"';
$replace = 'type="submit" disabled';
$previewtext = str_replace ($find, $replace, $previewtext);

$result['previewtext'] = $previewtext;
$this->post['message'] .= '<br />*********<br />'. $result['previewtext'];
}
...but they both had the same result:
Quote:
You can view the page at http://test.mydomain.com/content.php...ew-Text-Test-2
*********
Thanks in advance for any help you can give me.
Reply With Quote
  #7  
Old 01-18-2012, 06:36 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ah, sorry about that - previewtext is actually only in there if a preview break was set. So, you need to see if it's NULL and if not, then you need to create it.
Reply With Quote
  #8  
Old 01-20-2012, 12:17 PM
Webbstre Webbstre is offline
 
Join Date: Nov 2009
Posts: 175
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the help Lynne. I ended up giving up and using your original code for the full news posts. Originally I thought it was just going to post a copy of the news post in the first page of the comments, but now that I have seen it working I see it just draws directly from the CMS, which is better in any case! I was afraid I would have to maintain the preview post if I had to update it, so I wanted to keep it short, but it turns out I was trying something unnecessary.

Anyways, thanks again for trying to help. You're an awesome admin for vb.org
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:29 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03727 seconds
  • Memory Usage 2,239KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete