Link14716
08-30-2002, 10:00 PM
Ok, here is my 3rd Hack, the first with all of the code actually being mine :D
Updated with Velocd's fix! :banana:
So, what does this hack do, you ask? It adds a link next to the newest member taking you to their first post. If the user doesn not have a post, no link is shown.
So, here we go!
To Do:
2 File Mods (root/index.php)
1 Template Edit (forumhome)
---------------------------------------
New Member's First Post hack by squall14716
Inspired by ezboard.
---------------------------------------
---------------------------------------
open index.php
---------------------------------------
find:
---------------------------------------
$getnewestusers=$DB_site->query_first("SELECT userid,username FROM user WHERE userid=$numbersmembers[max]");
---------------------------------------
replace with:
---------------------------------------
$getnewestusers=$DB_site->query_first("SELECT userid,username,lastpost FROM user WHERE
userid=$numbersmembers[max]");
---------------------------------------
find:
---------------------------------------
// get newest member
$getnewestusers=$DB_site->query_first("SELECT userid,username,posts FROM user WHERE userid=$numbersmembers[max]");
$newusername=$getnewestusers['username'];
$newuserid=$getnewestusers['userid'];
---------------------------------------
add under:
---------------------------------------
if ($getnewestusers['lastpost'] != 0) {
$getnewusersposts=$DB_site->query_first("SELECT * FROM post WHERE userid=$newuserid LIMIT 1");
$userfirstpost=$getnewusersposts['postid'];
if (!$getnewusersposts) {
$firstpost="";
} else {
$firstpost=" | <a href='showthread.php?postid=$userfirstpost#post$us erfirstpost'>First Post!</a>";
}
}
---------------------------------------
Save and Close
---------------------------------------
Open up forumhome template
---------------------------------------
find:
---------------------------------------
Welcome to our newest member, <a href="member.php?s=$session[sessionhash]&action=getinfo&userid=$newuserid">$newusername</a>
---------------------------------------
Add DIRECTLY AFTER (on the same line)
---------------------------------------
$firstpost
---------------------------------------
Post any bugs/questions/suggestions here. ;) :banana:
Updated with Velocd's fix! :banana:
So, what does this hack do, you ask? It adds a link next to the newest member taking you to their first post. If the user doesn not have a post, no link is shown.
So, here we go!
To Do:
2 File Mods (root/index.php)
1 Template Edit (forumhome)
---------------------------------------
New Member's First Post hack by squall14716
Inspired by ezboard.
---------------------------------------
---------------------------------------
open index.php
---------------------------------------
find:
---------------------------------------
$getnewestusers=$DB_site->query_first("SELECT userid,username FROM user WHERE userid=$numbersmembers[max]");
---------------------------------------
replace with:
---------------------------------------
$getnewestusers=$DB_site->query_first("SELECT userid,username,lastpost FROM user WHERE
userid=$numbersmembers[max]");
---------------------------------------
find:
---------------------------------------
// get newest member
$getnewestusers=$DB_site->query_first("SELECT userid,username,posts FROM user WHERE userid=$numbersmembers[max]");
$newusername=$getnewestusers['username'];
$newuserid=$getnewestusers['userid'];
---------------------------------------
add under:
---------------------------------------
if ($getnewestusers['lastpost'] != 0) {
$getnewusersposts=$DB_site->query_first("SELECT * FROM post WHERE userid=$newuserid LIMIT 1");
$userfirstpost=$getnewusersposts['postid'];
if (!$getnewusersposts) {
$firstpost="";
} else {
$firstpost=" | <a href='showthread.php?postid=$userfirstpost#post$us erfirstpost'>First Post!</a>";
}
}
---------------------------------------
Save and Close
---------------------------------------
Open up forumhome template
---------------------------------------
find:
---------------------------------------
Welcome to our newest member, <a href="member.php?s=$session[sessionhash]&action=getinfo&userid=$newuserid">$newusername</a>
---------------------------------------
Add DIRECTLY AFTER (on the same line)
---------------------------------------
$firstpost
---------------------------------------
Post any bugs/questions/suggestions here. ;) :banana: