PDA

View Full Version : ATTN: Firefly, Report to Mod / IP Hack or Template Hack


LuBi
11-15-2001, 08:11 AM
I don't know who else would know this but if anyone could write up the code like on this page where a report button takes the place of the edit button for everyone except on their own posts where then there is no report button but in it's place an edit button. Whew! anyways I dunno who else would know this but I guess the IP logged link is gone or only available to mods etc etc.. so if anyone could set me in the right direction ;) :D Thanks!

Admin
11-15-2001, 10:24 AM
In functions.php, I added this:
if ($post[userid]==$bbuserinfo[userid] or ($bbuserinfo[usergroupid]=="5" or $bbuserinfo[usergroupid]=="6" or $bbuserinfo[usergroupid]=="7")) {
eval("\$post[editpost] = \"".gettemplate("postbit_editpost")."\";");
} else {
$post[editpost]="";
}

if ($post[userid]!=$bbuserinfo[userid]) {
eval("\$post[report] = \"".gettemplate("postbit_report")."\";");
} else {
$post[report]="";
}
right after this:
$post[joindate]=vbdate($registereddateformat,$post[joindate]);

You need to make some changes in the postbit template though.
Replace the edit button with $post[editpost], and create another template "postbit_editpost" that will contain that buttons.
Same thing for the report button, replace it with $post[report] and create a new template "postbit_report".

LuBi
11-15-2001, 03:04 PM
your the best! but wheres the IP logged link? Or did you remove it completely?

replace it with $post[report] and create a new template "postbit_report".

What am I replacing for $post[report]

Also what would one of those templates look like? Or can I just hack something up like (this is my report button)

<a href="report.php?s=$session[sessionhash]&postid=$post[postid]"><img src="{imagesfolder}/report.gif" border="0" alt="Report this post to a moderator"></a> ???

Basically now I have the edit show up all the time and the report show up only on thread that are not mine. How do i get one icon to take the place of another.. in the postbit?

http://www.suprascene.com/temp/problem.gif

Admin
11-15-2001, 04:02 PM
My postbit_report template:
<a href="report.php?s=$session[sessionhash]&postid=$post[postid]"><img src="{imagesfolder}/report.gif" border="0" alt="Report this post to a moderator"></a>

postbit_editpost template:
<a href="editpost.php?s=$session[sessionhash]&action=editpost&postid=$post[postid]"><img src="{imagesfolder}/edit.gif" border="0" alt="Edit/Delete Message"></a>

In my postbit I just place this:
$post[report]
$post[editpost]
where I want the button to appear.

BTW, it's coded so mods and admins will always see the edit button, and also the report button.
Only regular members can't see both of them at the same post. :)

So I would say you're fine...

LuBi
11-15-2001, 04:16 PM
rofl thanks! you know from dealing with me on these forums I'm nothing better than a script kiddie wit very little skill :D Thanks Again!

Oh lol you still haven't answered what about the IP logged? Where is that or when does it show up if at all!?

Admin
11-15-2001, 04:22 PM
Oh right, sorry.

I *think* I replaced this:
// do ip addresses
if ($post[ip]!="") {
if ($logip==2) {
eval("\$post[iplogged] .= \"".gettemplate("postbit_ip_show")."\";");
}
if ($logip==1) {
eval("\$post[iplogged] .= \"".gettemplate("postbit_ip_hidden")."\";");
}
if ($logip==0) {
$post[iplogged]="";
}
} else {
$post[iplogged]="";
}
with this:
// do ip addresses
if ($bbuserinfo[usergroupid]=="5" or $bbuserinfo[usergroupid]=="6" or $bbuserinfo[usergroupid]=="7") {
if ($post[ip]!="") {
if ($logip==2) {
eval("\$post[iplogged] .= \"".gettemplate("postbit_ip_show")."\";");
}
if ($logip==1) {
eval("\$post[iplogged] .= \"".gettemplate("postbit_ip_hidden")."\";");
}
if ($logip==0) {
$post[iplogged]="";
}
} else {
$post[iplogged]="";
}
}
Although I'm not sure about the original code. :)

And yes, it only shows up for mods/admins.

LuBi
11-15-2001, 04:31 PM
Thanks so much as usual! Everything worked great site looks clean, my real members love it!

everyone's gotta start somewhere, un-luckly for me I have only one direct compeditor with a solid foundation. So I fugure I'll have more than just a forum plus have a better faster more reliable feature packed forum to make it an easy transition for all his members. Everytime I get help on a hack or something from here I get closer to my goal! Now you know when I say thanks I really mean it :D

Lesane
01-09-2002, 12:18 PM
Just added it to my forum. Thanks FlyFire :D

voogru
02-07-2002, 05:34 PM
works like a charm :)

thanks

tanster
02-16-2002, 06:11 PM
Worked beautifully.

Thank you!
:) Jennie

212rikanmofo
04-21-2002, 06:18 PM
nice hack, but im having problems with the IP logged thing

how do i get it to show up as a button and not as a hyperlink?

where do i go to set this so it would show up the {imagesfolder}/ip.gif?

thanks