PDA

View Full Version : Support for forums in send-to-friend


Chen
07 Aug 2001, 16:16
Hey, this is my first hack, so if I'm doing anything wrong, please let me know. :)

This hack was requested by theflow.

Instructions:


A demo can be found on our forums:
http://forum.t-cove.com/
Just goto a forum.

Please feedback!!! :)

RobAC
07 Aug 2001, 18:39
Doesn't work for me. If I go to one of your Forums and press the "email this page to someone" link at the bottom, I get a "No thread specified. If you followed a valid link, please notify the webmaster" message.

VirtueTech
07 Aug 2001, 22:12
Likewise.

theflow
08 Aug 2001, 00:10
Originally posted by RobAC
Doesn't work for me. If I go to one of your Forums and press the "email this page to someone" link at the bottom, I get a "No thread specified. If you followed a valid link, please notify the webmaster" message.

Same here. Thanks for trying, Firefly...

I went to: http://forum.t-cove.com/forumdisplay.php?&forumid=21

Clicked "Email This Page to Someone!" (bottom of page)

and got error message:
http://forum.t-cove.com/sendtofriend.php?&threadid=

fyi, here's my 7-30-01 "How do I..." thread on this same subject:
http://www.vbulletin.com/forum/showthread.php?s=&threadid=24092

Chen
08 Aug 2001, 04:05
Don't give up just yet. ;)
It worked for me on my test forum, but I think I forgot something... :(

I'll work on it.

Chen
08 Aug 2001, 04:12
Ok, I fixed it. :D
Re-do steps 2 and 3.

Go here (http://forum.t-cove.com/forumdisplay.php?s=&forumid=14) for a demo.

theflow
08 Aug 2001, 04:22
Originally posted by FireFly
Ok, I fixed it. :D
Re-do steps 2 and 3.

Go here (http://forum.t-cove.com/forumdisplay.php?s=&forumid=14) for a demo.

That's the ticket... ****in' A it works great. I just emailed myself and checked it... sure enough, returned me to the threadlist page! Good job! Tomorrow I will find out how to do it... I am crashing right now....

Chen
08 Aug 2001, 04:46
moved to first post

orca
08 Aug 2001, 11:38
Good work. However, you don't use the vB colors in the template.

Chen
08 Aug 2001, 13:35
Thanks! :)

The problem with the colors was that when I wrote { firstaltcolor } the system replaced it with the actualy color for these forums. But I fixed it. Thanks for that too. :)

theflow
24 Aug 2001, 19:26
Firefly, I have not yet upgraded from 2.01 to 2.03. But will be doing so shortly. Nevertheless, when I asked a friend to implement your great hack for me, she said:

he references changing a file called online.php which is nowhere to be found on theflow website - could this be a file that was created in a newer release of vbulletin? I can't find that snippet of code in any files that we have.

Can you supply a tweek to your code based on the 2.01 release, or is that too difficult since you are not running it anymore?

Chen
24 Aug 2001, 19:30
If you do not use v2.0.2 or higher, you will not have online.php.
But the changes done to online.php are very very minor, and have absolutely no influence on the sent-to-friend functionality. You can safely install this hack, and skip step 2. :)

EDIT:
Just so you understand. The changes in online.php are done to make it so that when a user is on the new page, it won't show a "Unknown location" message, but a "Sending a page to friend" message. Since you don't use online.php, there's no need in this.

LuBi
04 Sep 2001, 08:13
What does this hack do?

Chen
04 Sep 2001, 11:49
LuBi:
Know that link, "Email This Page to Someone!" at the bottom of every thread?
Well this hack lets you also add this link to the bottom of every forum, to send the forum page to someone else.

LuBi
04 Sep 2001, 11:51
Thanks, great hack.

Chen
04 Sep 2001, 12:11
Thank you. :)

Saiyan XL
27 Feb 2002, 03:08
that god damn demo thing didn't work for me..

FleaBag
21 May 2002, 18:08
Thanks for this hack FireFly, very useful - though it needed a little editing for version 2.2.5 [I'll post the fixes in my next post]. :) Saiyan XL is right too, the demo doesn't work anymore.

FleaBag
21 May 2002, 18:15
OK, here's a little update for people using later versions of vBulletin such as myself [I'm using 2.2.5].

Firstly the following code found in step one [as shown below]...


if ($wordwrap!=0) {
$threadinfo[title]=dowordwrap($threadinfo[title]);
}

eval("dooutput(\"".gettemplate("sendtofriend")."\");");


...is different, and actually looks like this...


if ($wordwrap!=0) {
$threadinfo[title]=dowordwrap($threadinfo[title]);
}

eval("dooutput(\"".gettemplate("sendtofriend")."\");");


...and you need to replace it with this...


if ($wordwrap!=0) {
$foruminfo[title]=dowordwrap($foruminfo[title]);
}

eval("dooutput(\"".gettemplate("sendtofriendforum")."\");");


You'll also have to use this template rather than the one FireFly posted or you'll have extra HTML showing at the top of the page. So insert this into a new template called sendtofriendforum...


{htmldoctype}
<html>
<head><title>$bbtitle :: Send Page to a Friend</title>
$headinclude
</head>
<body>
$header

<form action="sendtofriendforum.php" method="post">
<input type="hidden" name="s" value="$session[sessionhash]"><input type="hidden" name="forumid" value="$forumid">

<table cellpadding="{tableouterborderwidth}" cellspacing="0" border="0" bgcolor="{tablebordercolor}" {tableouterextra} width="{contenttablewidth}" align="center"><tr><td>
<table cellpadding="4" cellspacing="{tableinnerborderwidth}" border="0" {tableinnerextra} width="100%">
<tr>
<td bgcolor="{tableheadbgcolor}" colspan="2"><normalfont color="{tableheadtextcolor}" class="thtcolor"><b>Send This Page To A Friend</b></normalfont></td>
</tr>
$logincode
<tr>
<td bgcolor="{secondaltcolor}"><normalfont><b>Send To (Person's Name):</b></normalfont></td>
<td bgcolor="{secondaltcolor}"><normalfont><input type="text" class="bginput" name="sendtoname" size="25" maxlength="75"></normalfont></td>
</tr>
<tr>
<td bgcolor="{firstaltcolor}"><normalfont><b>Send To (Email Address):</b></normalfont></td>
<td bgcolor="{firstaltcolor}"><normalfont><input type="text" class="bginput" name="sendtoemail" size="25" maxlength="100"></normalfont></td>
</tr>
<tr>
<td bgcolor="{secondaltcolor}"><normalfont><b>Subject:</b></normalfont></td>
<td bgcolor="{secondaltcolor}"><normalfont><input type="text" class="bginput" name="emailsubject" value="$threadinfo[title]" size="25" maxlength="100"></normalfont></td>
</tr>
<tr>
<td bgcolor="{firstaltcolor}" valign="top"><normalfont><b>Message:</b></normalfont></td>
<td bgcolor="{firstaltcolor}"><textarea name="emailmessage" rows="10" cols="50">I thought you might be interested in reading this web page:
$bburl/forumdisplay.php?forumid=$forumid&referrerid=$bbuserinfo[userid]

From,
$bbuserinfo[username]
</textarea></td>
</tr>
</table>
</td></tr></table>

<br>

<table cellpadding="2" cellspacing="0" border="0" width="{contenttablewidth}" {tableinvisibleextra} align="center">
<tr>
<td align="center"><normalfont>
<input type="submit" class="bginput" name="submit" value="Send Email Now!" accesskey="s">
<input type="hidden" name="threadid" value="$threadid">
<input type="hidden" name="action" value="sendfriend">
</normalfont></td>
</tr>
</table>

</form>

$footer

</body>
</html>


...and finally, an extra step; edit your existing template called redirect_sentemail and replace it with the following - this changes the word Thread to Page, so it applies to threads and forums, and is also slightly more explanatory.


We have sent your email to $sendtoname. You will now be returned to the page that you sent to your friend.


Hope this might have helped some of you, and thanks again to FireFly for the hack! :)

FleaBag
20 Jun 2002, 10:46
Working on 2.2.6, doesn't need any changes between upgrade if you use FireFly's Add Who's Online Locations from Admin CP (http://www.vbulletin.org/forum/showthread.php?s=&threadid=32849) - otherwise just re-apply the changes to online.php! :)

FleaBag
04 Sep 2002, 08:10
Works with 2.2.7. :)

TMM
08 Apr 2003, 09:53
Will this work with 2.2.9 & 2.3.0?

Can anyone point me to a working demo (or screenshots)?