PDA

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


Admin
08-06-2001, 10:00 PM
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
08-07-2001, 05:39 PM
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
08-07-2001, 09:12 PM
Likewise.

theflow
08-07-2001, 11:10 PM
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

Admin
08-08-2001, 03:05 AM
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.

Admin
08-08-2001, 03:12 AM
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-08-2001, 03:22 AM
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....

Admin
08-08-2001, 03:46 AM
<i>moved to first post</i>

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

Admin
08-08-2001, 12:35 PM
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
08-24-2001, 06:26 PM
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?

Admin
08-24-2001, 06:30 PM
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
09-04-2001, 07:13 AM
What does this hack do?

Admin
09-04-2001, 10:49 AM
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
09-04-2001, 10:51 AM
Thanks, great hack.

Admin
09-04-2001, 11:11 AM
Thank you. :)

Saiyan XL
02-27-2002, 02:08 AM
that god damn demo thing didn't work for me..

FleaBag
05-21-2002, 05:08 PM
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
05-21-2002, 05:15 PM
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
06-20-2002, 09:46 AM
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 (https://vborg.vbsupport.ru/showthread.php?s=&threadid=32849) - otherwise just re-apply the changes to online.php! :)

FleaBag
09-04-2002, 07:10 AM
Works with 2.2.7. :)

TMM
04-08-2003, 08:53 AM
Will this work with 2.2.9 & 2.3.0?

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