View Full Version : Do not include posts from a thread in New Posts.
Tenny
01-24-2005, 09:00 PM
Hey Everyone,
I finally got my RSS Bot working, and it works great. I am now looking for a way so that it does not spam the New Posts, and other such features. I would like to have it where you have to click that forum to see the posts in there, and that it would not be visible via "New Posts" and in the "VBAdvanced Home".
Not sure if there is a hack that exists like this, but I've gone through about 10 pages of the search looking for something along these lines with no hits... So if there already is one, can someone point me in the right direction.
Thanks,
Drew
WetWired
01-26-2005, 04:33 PM
So, does your bot just post in one forum and that's all that's in the forum? If so, you can remove all users' permissions to search that forum. Otherwise, you'd probably need to add a column to the post table to specify whether a post was a user post or a bot post then include that in the search query where clause.
Tenny
01-26-2005, 04:42 PM
Yes, my RSS bot posts in one particular forum, I was able to remove that forum on the vBa CMPS, and the newpost button (by adding &exclude=xx) (xx= forum number).
But the only thing I've been unable to do is, on the vBa CMPS it says: New Posts: $newposts, and I have not been able to find where $newposts comes from, so that I can exclude that forum.
WetWired
01-26-2005, 04:52 PM
I have no experience with vBAdvanced, but to find new posts, the query is going to need to access $bbuserinfo['lastvisit'], so I would search for that in the vBa source. Alternately, since it's a counting query, you could search for COUNT(*) . Once you find the query, it would be pretty simple to exclude a forumid.
I've got the same problems .. I use the RSS to feed into 4 seperate forum category's for different news items .. ie .. Sport, Tech, UK News, World News. If anyone finds the method to remove these posts from the users 'new posts' listing, I'd be interested to know.
Tenny
01-26-2005, 06:34 PM
Ok well I found this, and i'm pretty sure this is waht you are talking about (this is in the /vbb/modules/welcomeback.php)
if ($vba_options['portal_welcome_newposts'])
{
$getnewposts = $DB_site->query_first("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "post WHERE dateline >= '$bbuserinfo[lastvisit]'");
$newposts = number_format($getnewposts['count']);
}
}
Being I'm a complete n00b with coding... (Business major...) anyone with idea's on how to exclude certain forums?
Andreas
01-26-2005, 06:39 PM
$getnewposts = $DB_site->query_first("
SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "post AS post
LEFT JOIN " . TABLE_PREFIX . "thread AS thread ON (thread.threadid=post.threadid)
WHERE post.dateline >= '$bbuserinfo[lastvisit]' AND thread.forumid NOT IN (1,2,3)
");
This will exclude posts in forums 1, 2 and 3
Tenny
01-26-2005, 06:46 PM
sweet KirbyDE, it looks like it's working perfectly, but I won't be 100% sure untill the RSS spams 30 new posts :)
Sooner95
01-26-2005, 06:59 PM
I the forums disabled in search.php so that they dont show up when you click "new posts" ect..
can this be done for the forumhome as well? so that when members log on they dont see
example 34 posts 26 thread since last visit
they see new posts new threads that they can actually see when clicking "new posts"
Tenny
01-26-2005, 07:10 PM
Sooner95: not quiet sure what you are talking about. Probably because I'm not logged in.
It seems kinda simliar to what I'm talking about, in the CMPS, but I don't see that in my forum index. But from how you explain it, i'm sure it'd be done with the same code almost exactly. Just got to find out where it says 34 Posts, 26 threads since your last visit. So wherever that is, I would try and search through the php to find that, and if there is something along the lines of " $getnewposts = $DB_site->query_first " i would grab that particular code that KirbyDE wrote, and slap it in there (with making a backup of the php file first of course).
That's my only idea?
Sooner95
01-26-2005, 07:21 PM
yea, thats what i am thinking too..
i found the code in the navbar template
<if condition="$show['pmstats']"><br /><phrase 1="$vbphrase[unread_x_nav_compiled]" 2="$vbphrase[total_x_nav_compiled]" 3="$session[sessionurl]">$vbphrase[private_messages_nav]</phrase></if>
<br /><phrase 1="$getnewthread[threads]" 2="$getnewpost[posts]" />$vbphrase[navbar_sincelastvisit]</phrase>
just not sure what to edit, once i get home, i can play around with it, and search my server see if a php edit is needed as well..unless someone beats me to it here...
thx for your help
edit
======
Welcome, Sooner95.
You last visited: Today at 01:42 PM
Private Messages: 0 Unread, Total 36.
There have been 7 threads and 7 posts since your last visit!
that thing, just above the navbar.. and for example outta those 7 posts in 7 threads, 5 of them are RSS posts in forums that are disabled from new post searching. just wondering if I can have it say 2 threads and 2 posts since last visit, instead, excluding any posts into forums that i dont want to show up..
Sooner95
01-28-2005, 01:22 AM
anyone have any suggestions? thanks
WetWired
01-28-2005, 05:07 PM
If you've been paying attention at all, you'd know that we'd need you to find the query in your hack for us to help you. Noone here is intimately familiar with every hack, and noone can read your mind to know which ones you have installed.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.