PDA

View Full Version : Get new Posts, but not own


Wolf42
03-03-2002, 10:00 PM
This is one I requestet for myself. But it was almost easier than i though. The idea was to search for new postings, but not the own ones. Very simple. ;)

How to do:

In seach.php

Find
// ###################### Start get new #######################
if ($action=="getnew") {
// generate query
// do it!
if ($bbuserinfo[userid]!=0 or $bbuserinfo[lastvisit]!=0) {
$forumsql=getallforumsql();

after this insert

$usersql=" AND thread.lastposter<>'".addslashes($bbuserinfo[username])."'";

then find about 11 lines down
// get date:
$datesql=" AND thread.lastpost>=".$bbuserinfo[lastvisit];

$wheresql="1=1".$forumsql.$datesql;
$wheresql.=" AND thread.open<>10";

and insert this

$wheresql.=$usersql;

Save and upload the file. Thats all.

Have Phun! :D

Admin
03-04-2002, 11:22 AM
(a) You don't need to addslashes() to numbers -- because they simply don't have any slashes! :)

(b) You should release the hack in a text file, so users can download and save it for later. :)

Wolf42
03-04-2002, 11:28 AM
Originally posted by FireFly
(a) You don't need to addslashes() to numbers -- because they simply don't have any slashes! :)

(b) You should release the hack in a text file, so users can download and save it for later. :)

ad a: What number is the USERNAME? :confused:

ad b: done.

Admin
03-04-2002, 11:34 AM
Huh? You don't need to addslashes($bbuserinfo['userid']), just use $bbuserinfo[userid] without quotes around it.

Wolf42
03-04-2002, 11:43 AM
Originally posted by FireFly
Huh? You don't need to addslashes($bbuserinfo['userid']), just use $bbuserinfo[userid] without quotes around it.
I wrote addslashes($bbuserinfo[username]) and not $bbuserinfo[userid]! It dosn't work with userid, couse in the thread-table the last poster is the username and not his/hers ID.

Admin
03-04-2002, 11:44 AM
Duh... sorry, I wasn't looking carefully enough. :)

The Ghost
04-01-2002, 10:25 AM
Hi,

I wants to know something: Works this Hack with Version 2.2.4?

thx

Greetz

The Ghost

Wolf42
04-03-2002, 07:25 AM
Yes, it does.

The Ghost
06-02-2002, 02:34 PM
hi,

thx, work's fine!! :classic: