Announcement

Collapse
No announcement yet.

Trying to build a thread ignore system.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Trevor Hannant
    replied
    Have you tried searching at www.vbulletin.org?

    Leave a comment:


  • Leinad_r
    replied
    anybody knows if such a add-on exists for vb4?

    Leave a comment:


  • Paul M
    replied
    There seems to be a somewhat strange mapping in the searchcontroller.

    Code:
    	private static $field_map = array
    	(
    		'user' => 'userid',
    		'dateline' => 'dateline',
    		'groupid' => 'groupid',
    		'threadid' => 'groupid',
    		'contenttypeid' => 'contenttypeid',
    
    		'defaultdateline' => 'dateline',
    		'groupdateline' => 'dateline',
    
    		'defaultuser' => 'userid',
    		'groupuser'   => 'userid',
    
    		'rank'  => 'score',
    		'relevance'  => 'score'
    	);
    Just out of interest, can you change that to 'threadid' => 'threadid', and see if your plugin works.

    Leave a comment:


  • Pandemikk
    replied
    I think Andy means that the search criteria doesn't ignore threads. So you're trying to hack something into a query that doesn't exist.

    You'll have to modify the actual search criteria itself and add a "AND threadid NOT IN ($excluded_threadids)" at the end. You'll want to do some sanitizing and other obvious stuff as well.

    Leave a comment:


  • nerbert
    replied
    Originally posted by Andy View Post
    The default code doesn't have a provision to ignore by threadid. You would have to hack that in.
    That's what the last line of the plug in is supposed to do. The one above it successfully ignores forums. I even tried hacking a full blown thread ignore function into vb/search/criteria.php:

    PHP Code:

        
    public function add_excludethread_filter($threadids)
        {
            global 
    $vbphrase;

            
    $this->add_filter('threadid'vB_Search_Core::OP_NEQ$threadids);
            
    $this->add_display_strings('exclude_forum'vB_Search_Searchtools::getDisplayString('forum'$vbphrase['excluded_forums'], 'title''forumid'$forumidsvB_Search_Core::OP_NEQfalse));
        } 

    It's based on add_excludeforum_filter($forumids) on line 460. Still doesn't work. I suspect an alias for threadid in the query but damned if I can find away to see or output the query string.

    PHP used to be fun.

    Leave a comment:


  • Andy
    replied
    Originally posted by nerbert View Post
    Am I doing something wrong or is it somehow impossible to ignore posts by threadid?
    The default code doesn't have a provision to ignore by threadid. You would have to hack that in.

    Leave a comment:


  • nerbert
    replied
    Originally posted by IBxAnders View Post
    You do realize that you can block certain forums from appearing in search results by going to Forum Manager -> Edit forum settings -> Index posts in Search
    But that does it for everyone. I would want it so users can select which forums to ignore. Besides that I'm mostly interested in ignoring threads.

    I can't see why I can't exclude posts based on threadid, presumably if you can exclude them by forumid or userid, then the same should go for threadid.

    Leave a comment:


  • IBxAnders
    replied
    You do realize that you can block certain forums from appearing in search results by going to Forum Manager -> Edit forum settings -> Index posts in Search

    Leave a comment:


  • nerbert
    started a topic Trying to build a thread ignore system.

    Trying to build a thread ignore system.

    Using vB 4.1.5 PS

    I had an add-on for vB3.7.3 for ignoring threads, forums and tags but with the new search system it no longer works, so I want to build up a new one from scratch. I'm not interested much in forums or tags, mostly threads and it only needs to work in New Posts or Daily Posts.

    So in my experimental version of search.php I hacked in a hook at the bottom of function set_newitem_forums($criteria) (line 1146) and tried the following plugin:

    PHP Code:
    if($vbulletin->userinfo['userid'] == 5)
    {
    //echo 'Testing plugin for ignore system.';
     
    ini_set('display_errors''1');

    $thread_string '7491,3161,7555';
    $forum_string '16,17';

    $threads explode(','$thread_string);
    $threads array_map('intval'$threads);

    $forums  explode(','$forum_string);
    $forums  array_map('intval'$forums);

    global 
    $vbphrase;
    $criteria->add_filter('forumid',  vB_Search_Core::OP_NEQ$forums);
    $criteria->add_filter('threadid'vB_Search_Core::OP_NEQ$threads);

    It works fine for ignoring forums (which I could already do) but the thread ignore doesn't work. Am I doing something wrong or is it somehow impossible to ignore posts by threadid?
widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Working...
X