PDA

View Full Version : Hack: Make "Report post..." a button like Edit/Delete, Profile, etc.



JJR512
Mon 16th Apr '01, 3:59am
This little hack of mine isn't much. It's just that I didn't really like the look of the text link to "Report this post to a Moderator", especially in the message body area. So I did two things: I made a button that says "report", in the same style as the other buttons in a message, and I placed it in the same section, to the right of the "edit/delete" button. I just think it looks nicer that way.

It's very simple to do.

First, upload the attached image to your images directory, the same place where you find the files edit.gif, profile.gif, etc. (Note that I have made this button in a blue shade, since that is my site's look. You can easily make it the default vBulletin purple, or any other color, with Paint, which comes with Windows.)

Next, in the postbit template, find this:

<p><smallfont><a href="report.php?s=$session[sessionhash]&postid=$post[postid]">Report this post to a moderator</a></smallfont></p>
Delete that entire code bit.

Next, find this:

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

After the above code bit, add this:

<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>

JJR512
Mon 16th Apr '01, 4:01am
Sorry, I forgot to attach the button. Here it is now! :)

JJR512
Mon 16th Apr '01, 4:13am
I just wanted to add that I did this hack on Beta 5. Earlier versions may be the same, or similar. You should probably be able to figure it out. It's all in the postbit template, and you're just moving the text link to a different place, and changing it from a text link to an image link.

Here is a demo thread: http://www.jjr512.com/forums/showthread.php?s=&threadid=20604

You may notice that I also made the IP: Logged text link into a button link, too. I've attached that button to this post, and here is what you do to switch it.

In the postbit_ip_hidden template, change the entire template to this:

<a href="postings.php?s=$session[sessionhash]&action=getip&postid=$post[postid]"><img src="images/ip.gif" border="0" width="37" height="18" alt="IP Logged"</a>

Wayne Luke
Mon 16th Apr '01, 12:49pm
This isn't a hack. It is a simple template change.

JJR512
Mon 16th Apr '01, 1:31pm
Well excuse me, I am so very very sorry. I wasn't aware of the technical definition for a hack, I supose. I thought that simple appearance changes, like colors, didn't count as a hack. But I assumed that when you started changing the layout of the board, that that could be considered a hack. But I guess maybe a hack is only when you edit the program files maybe? (I guess in UBB, this would be considered a hack, since it doesn't have any templates, everything must be done in the program files!).

So OK, I'm sorry this wasn't a hack. Since it's not a hack, I guess it doesn't belong in this forum, then. So go ahead and move it to the "Template Changes" forum.

Wayne Luke
Mon 16th Apr '01, 2:15pm
Anything involving templates only is a template change...

Anything involving the underlying PHP code is a hack.

It is not that you were wrong, I was just informing you for the future. I know a lot of people come from a UBB background where any simple change could require hacking the code. However vBulletin is simpler and makes all the HTML available to you in the templates.