TinyPortal

Development => Block Codes => Topic started by: Defile on March 31, 2006, 07:27:04 PM

Title: Refer a friend
Post by: Defile on March 31, 2006, 07:27:04 PM
Has anyone wrote anything like this? a block where a member on your site could enter a friends email and it would send them an invite for them to join up. If so could you share please ;)
Title: Re: Refer a friend
Post by: G6Cad on March 31, 2006, 07:31:33 PM
If you mean send a topic or post from a forum it's allready built in SMF forums.
When you are in a post or topic you have a button that say "send topic"

From there you can add emailadress and the reason you want the person to follow up on the link you just emailed them.  :)

EDIT! read back again and saw that it wasent what you asked for.
I think i have seen such snippet here or back at SMF forums.
They call the snippet "tell a friend" so do a search for it here or back in SMF.
Title: Re: Refer a friend
Post by: Defile on March 31, 2006, 07:41:38 PM
Thank you very much.

I'll go go search for it ;)
Title: Re: Refer a friend
Post by: alan s on March 31, 2006, 07:45:45 PM
http://www.simplemachines.org/community/index.php?topic=37698.0
Title: Re: Refer a friend
Post by: RoarinRow on March 31, 2006, 08:48:08 PM
That's very cool.  Testing it now.  ;)
Title: Re: Refer a friend
Post by: Xarcell on April 06, 2006, 04:30:43 AM
Does it work?
Title: Re: Refer a friend
Post by: RoarinRow on April 06, 2006, 04:59:46 AM
Quote from: Xarcell on April 06, 2006, 04:30:43 AM
Does it work?

Didn't work for me.   ???  I entered my name and email address and the recipient's information, which was my own test accounts and I never received anything.
Title: Re: Refer a friend
Post by: Lesmond on April 06, 2006, 05:46:15 PM
I use this (http://www.cgiscript.net/cgi-script/csNews/csNews.cgi?database=cgi.db&command=viewone&id=3)
but you need to have cgi on your host which I think most have, I put it in a article and Iframe, works fine, go to my site below and click on the "recommend us" button in the left block :)

http://www.lesmonds.co.uk/smf/index.php
Title: Re: Refer a friend
Post by: Crip on April 06, 2006, 06:16:45 PM
Thats pretty cool, think I'll use it, I love CGI. :)
Title: Re: Refer a friend
Post by: cervante on April 15, 2006, 04:21:38 PM
I am having a little trouble with the csRecommend script.
I downloaded, installed and got the script working. The test script sends an email fine.
I installed a block, but when I click on it, no page pops up, nor does it take me to a page.
I went to Lesmonds Place, and the same results, click on the button and nothing to fill out.
Does the html of the site require a "call" to javascript?
Mine is in text, when I try to open in a new window I get the following;
In the address bar: javascript:ShowRecommend();
and a "Page Cannot Be Displayed error.
Title: Re: Refer a friend
Post by: Lesmond on April 15, 2006, 04:35:28 PM
Mine dosent open in a new window, I have it in a article and Iframe, works ok for me

try this in a article and iframe..
<iframe src="http://yoursite.com/Recommend/csRecommend.cgi?command=showrecommend&page=http%3A//www.lesmonds.co.uk/smf/index.php"height="500" width="100%" frameborder="0" Scrolling="no"></iframe>

and this in a block to link to the article

<center><form method="POST" action="http://www.yoursite.com/smf/index.php?page=your page #">
<p><button name="B3">Recommend Us</button></p>
</form>
</center>
Title: Re: Refer a friend
Post by: Lesmond on April 15, 2006, 04:40:01 PM
your right it doesn't work in IE :( I never tried it before, boy how do I fix that??
Title: Re: Refer a friend
Post by: Lesmond on April 15, 2006, 05:08:49 PM
Ok I think I have it fixed! try it now
Title: Re: Refer a friend
Post by: cervante on April 15, 2006, 05:19:40 PM
That works...ok, how did you get it working?
Title: Re: Refer a friend
Post by: Lesmond on April 15, 2006, 05:28:22 PM
I hade to put this in the block, I used a javascript/html one

<center><form method="POST" action="http://www.lesmonds.co.uk/smf/index.php?page=14">
<p>
<button name="Recommend" value="http://www.lesmonds.co.uk/smf/index.php?page=14" type="submit">Recommend Us</button></p>
</form>
</center>

dont know why I had to put the url in twice though but it worked :)
Title: Re: Refer a friend
Post by: rbh on April 15, 2006, 09:51:34 PM
    lesmond, do you have to upload the script into cgi-bin or into your root directory? i uploaded to my htdocs and set everything up just fine with no problems. i tested it on my site and never recieved an email.
Title: Re: Refer a friend
Post by: Lesmond on April 15, 2006, 10:16:45 PM
I have mine in the root, have you set the path to perl? mine is #!/usr/bin/perl
Title: Re: Refer a friend
Post by: Xarcell on April 15, 2006, 10:55:45 PM
Nice little script.
Title: Re: Refer a friend
Post by: alan s on May 01, 2006, 09:47:43 PM
Quote from: Lesmond on April 15, 2006, 04:35:28 PM
Mine dosent open in a new window, I have it in a article and Iframe, works ok for me

try this in a article and iframe..
<iframe src="http://yoursite.com/Recommend/csRecommend.cgi?command=showrecommend&page=http%3A//www.lesmonds.co.uk/smf/index.php"height="500" width="100%" frameborder="0" Scrolling="no"></iframe>

and this in a block to link to the article

<center><form method="POST" action="http://www.yoursite.com/smf/index.php?page=your page #">
<p><button name="B3">Recommend Us</button></p>
</form>
</center>


i cant get the thing in the iframe to work? or am i doing something wrong im just putting the code into a php article and changing the links
Title: Re: Refer a friend
Post by: G6Cad on May 01, 2006, 09:51:10 PM
Quote from: Lesmond on April 15, 2006, 05:28:22 PM
I hade to put this in the block, I used a javascript/html one

<center><form method="POST" action="http://www.lesmonds.co.uk/smf/index.php?page=14">
<p>
<button name="Recommend" value="http://www.lesmonds.co.uk/smf/index.php?page=14" type="submit">Recommend Us</button></p>
</form>
</center>

dont know why I had to put the url in twice though but it worked :)

4 posts over yours ;)
Title: Re: Refer a friend
Post by: alan s on May 03, 2006, 03:12:42 PM
im getting a error

Parse error: parse error, unexpected '<' in /home/smith/public_html/forums/Sources/Load.php(1607) : eval()'d code(119) : eval()'d code on line 1


Title: Re: Refer a friend
Post by: alan s on May 06, 2006, 03:31:56 PM
can anyone help?
Title: Re: Refer a friend
Post by: Gidget on May 06, 2006, 03:43:59 PM
Hi Alan

I got an error similar to yours when I first tried to create the article.  What I did to get around it was to turn off the WYSIWYG editor in the TP settings, then just post the HTML code Lesmond gave into an article.  The WYSIWYG editor adds in extra stuff and stops it working.  Once you've created the article, you can turn the WYSIWYG editor back on, but be wary of trying to edit this particular article later on while the WYSIWYG editor is active as it can have some nasty side-effects, like dumping you out of SMF.  It's fine as long as you turn off the WYSIWYG editor before editing the article.

Hope this helps.

Gidget
Title: Re: Refer a friend
Post by: Lesmond on May 06, 2006, 03:51:53 PM
I have just been looking at this and I had my WYSIWYG editor off too, but not for the same reason, I am sorry I had forgot until I saw your post, Hope it works OK now Alan :) 

Thanks Gidget
Title: Re: Refer a friend
Post by: Gidget on May 06, 2006, 04:00:12 PM
Hi Lesmond

While you're here  :) I've got another question ...

When I view the referral article in Internet Explorer, I get a white background - in Firefox I get my theme background colour (which is what I want).  On your site, when viewing the article in IE it starts off with a white background and then refreshes with your dark theme background.

Any idea how I can get my article to behave the same way?
http://www.post-polionetwork.org.au/smforum/index.php?page=61

By the way, I don't have a block with a Recommend button - I just link to the article from a menu item.  I don't know if this makes any difference  ???

Cheers

Gidget
Title: Re: Refer a friend
Post by: Lesmond on May 06, 2006, 05:02:06 PM
In the images folder there is a jpg images called bkg.jpg I have just changed the color to what I want, and uploaded it to the same folder overwriting the other, I have added the one I use, hope this helps

Les
Title: Re: Refer a friend
Post by: alan s on May 06, 2006, 05:47:05 PM
i did that and im still getting the same error
Title: Re: Refer a friend
Post by: evilicy on November 08, 2006, 10:04:50 PM
Hi, Last night I installed pf-recommend on my site and it works great for me. It's very easy to set up.

1. Download and extract the attachment

2. Edit the config.php email_template.txt with your info, you may also want to edit the 2 html files so the color suits your site.

3. Upload the files into the same directory on your server.

4. Create a new script box with this code, obviously changing the info to yours.

<iframe id="example" src="http://darkvoid.org/example.html" width=155 height=200 marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no></iframe>
<layer visibility=hide>
</layer>


that's it! oh yeah and activate! ;p

I have it as a side block you can chack it out here Demo (http://darkvoid.org)
Title: Re: Refer a friend
Post by: RoarinRow on November 08, 2006, 10:26:10 PM
Very cool evilicy   :up:   I'll have to try it out  8)
Title: Re: Refer a friend
Post by: evilicy on November 08, 2006, 11:32:44 PM
Just keep in mind if testing it out if spam filters are on it may end up in your junk mail folder ;p
Title: Re: Refer a friend
Post by: ScoobyDan on November 09, 2006, 10:56:46 AM
evilicy,

Just what I was looking for! :D

I would like this to only be available for registered users (easy enough to do with TP permissions), but I would also like the name and e-mail address to default to the user's real name and e-mail address. I'm no PHP guru, so how easy would this be to accomplish?

Many thanks,

Daniel
Title: Re: Refer a friend
Post by: evilicy on November 09, 2006, 10:03:49 PM
I don't imagion to hard, but I can't really tell you because I don't know. Anytime I need to edit or work with php it usually starts here http://google.ca "How to....." but if I find out before someone else replies I will certainly let you know.
Title: Re: Refer a friend
Post by: RoarinRow on March 03, 2007, 03:29:06 AM
I re-introducted this snippet on my forum.  I went to Hotscripts - http://www.hotscripts.com/Detailed/61284.html then did a search on 'Recommend' then clicked the first Tell a Friend PHP Script block and just followed it to the zip file, which contains all the files you need.

Once you extract the files you should edit the 'header.php' file with details of your site.  You'll probably want to change to the logo.gif and admin gif to your own as well.

Then upload all the files to a directory like 'tell'

Also per the included instructions you'll have to chmod the conf.php to 777.

Once you get into the admin section, then you configure the settings, verbiage you want to go out to the friends of your members, the URL of your site and return URL after they submit their friend's email list.

Here's what it looks like - http://www.avalanchestyle.net/tell/tell.php
Title: Re: Refer a friend
Post by: RoarinRow on March 03, 2007, 09:10:06 PM
SMF just came out with an invitee mod - here (http://www.simplemachines.org/community/index.php?topic=154999.0).

This MOD adds an invite system to SMF.  Users get invite credits which they can use to invite people to the forum, and showing who invited whom.  The forum can also be set to only accept registrations through invitations, meaning that you need to be invited to join.
Title: Re: Refer a friend
Post by: texasflats on March 17, 2007, 03:55:03 PM
I'm using the invite mod, it's awesome.
Title: Re: Refer a friend
Post by: RoarinRow on March 17, 2007, 04:25:37 PM
Quote from: texasflats on March 17, 2007, 03:55:03 PM
I'm using the invite mod, it's awesome.

i was using that too, but because he had so many versions mine got messed up.  so i ended up removing it and just using a simple non-integrated mod for refering a friend.  Looks like this - http://www.avalanchestyle.net/tell/tell.php