Webmastersite.net
Register Log In

Voting script
Add link id to voting script

Comments on Voting script

egdcltd
Member

Usergroup: Customer
Joined: May 06, 2005

Total Topics: 5
Total Comments: 15
egdcltd
Posted Feb 25, 2006 - 8:14 AM:

I am currently using WSN Links to run a directory of games that are all hosted on my site. Clicking on a link takes you to a page with the game on it. I would like to add voting scripts to all these pages. I know I can copy & paste the "Get voting code to place on your site" html, but this would mean adding it to each game page individually. What I would like to do, if possible, is have the link id added automatically to the voting script, which would just be added to my php game page template. Is there any way of doing this?
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Feb 25, 2006 - 4:47 PM:

Are you just asking how to pass a link id? See the template variables, articles, at scripts.webmastersite.net/w...inks/wsnmanual/articles/10 {LINKID} is the first one covered.
egdcltd
Member

Usergroup: Customer
Joined: May 06, 2005

Total Topics: 5
Total Comments: 15
egdcltd
Posted Feb 26, 2006 - 3:42 AM:

I am trying to pass the link is. However, the pages I am trying to pass it to are not part of the WSN template system.
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Feb 28, 2006 - 12:53 AM:

So... either the page you pass it to understands the value you pass or it doesn't, depending on how you make this page.
egdcltd
Member

Usergroup: Customer
Joined: May 06, 2005

Total Topics: 5
Total Comments: 15
egdcltd
Posted Feb 28, 2006 - 3:23 AM:

Currently the page does not understand the variable. How do I create the page so that it does understand the variable and gets passed it by the link when it is clicked on? I was looking at creating custom templates, but that looks like I would need to create a new template for each page. Also, the link to use WSN templates outside of the directory where you have WSN installed on scripts.webmastersite.net/w...g_a_Custom_Template-5.html doesn't work
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Mar 02, 2006 - 1:51 AM:

Fixed link.

that looks like I would need to create a new template for each page

No... simply pass linkid={LINKID} in the url (I think that was the var name, if it doesn't work just overlay it onto the link details page and pass it the id as usual).

Anyhow, you have yet to specify what "understand" means. It could mean emailing someone, deleting the link, or juggling chainsaws.
egdcltd
Member

Usergroup: Customer
Joined: May 06, 2005

Total Topics: 5
Total Comments: 15
egdcltd
Posted Mar 02, 2006 - 3:50 AM:

Okay, so the link to the page from the directory would have linkid={LINKID} in it.
So, instead of having the URL as, say, games.directorygold.com/gam...h/littleshepherd/index.php it would instead be games.directorygold.com/gam...ex.php?linkid={LINKID}

The voting script on each page would be
<form action="http://games.directorygold.com/gamezone/vote.php?action=vote&id={LINKID}" method="post">
<b>Rate this site:</b>
<select name="votevalue">
<option value="5">5 - Perfect</option>
<option value="4">4 - Good</option>
<option value="3">3 - Average</option>
<option value="2">2 - Mediocre</option>
<option value="1">1 - Bad</option>
</select>
<input type="submit" value="Rate this site">
</form>

What I mean by understand, is that the page in question would need to be able to read the variable {LINKID} wouldn't it?
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Mar 03, 2006 - 2:11 AM:

The template code you posted would go in a template which would thus understand it. See the normal voting form for example and read the manual category on custom templates if you don't understand them.
egdcltd
Member

Usergroup: Customer
Joined: May 06, 2005

Total Topics: 5
Total Comments: 15
egdcltd
Posted Mar 06, 2006 - 5:34 AM:

Okay, I've created a custom template in the custom directory called gametemp.tpl, code below:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<? include("head.php"); ?>

<? include("http://games.directorygold.com/gamezone/header.php"); ?>

<center>

<?include("code.php"); ?>

<br /><br />

<form action="http://games.directorygold.com/gamezone/vote.php?action=vote&id={LINKID}"

method="post">
<b>Rate this site:</b>
<select name="votevalue">
<option value="5">5 - Perfect</option>
<option value="4">4 - Good</option>
<option value="3">3 - Average</option>
<option value="2">2 - Mediocre</option>
<option value="1">1 - Bad</option>
</select>
<input type="submit" value="Rate this site">
</form>


</center>

<? include("http://games.directorygold.com/gamezone/footer.php"); ?>

In, for example, gamezone/flash/meteorswarm/index.php, index.php is

<?php
$custom = 'yes';
$TID = 'custom-gametemp';
require 'index.php';
?>

Files head.php & code.php are also in the same folder.

When calling this file, I get a 500 Server Error. What am I doing wrong?
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
#10 - Quote - Permalink
Posted Mar 09, 2006 - 7:55 AM:

Test to find out. Does
<?php
$custom = 'yes';
$TID = 'main';
require 'index.php';
?>
work? If so, it's something in your template, probably one of your php includes.
egdcltd
Member

Usergroup: Customer
Joined: May 06, 2005

Total Topics: 5
Total Comments: 15
egdcltd
#11 - Quote - Permalink
Posted Mar 09, 2006 - 8:25 AM:

Okay, when I try in a test page

<?php
$custom = 'yes';
$TID = 'main';
require 'index.php';
?>

I get a totally blank screen.

I now also get that when accessing gamezone/flash/meteorswarm/index.php instead of a server error
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
#12 - Quote - Permalink
Posted Mar 10, 2006 - 1:06 AM:

Well do you actually have an index.php in that directory where you're placing this file?
egdcltd
Member

Usergroup: Customer
Joined: May 06, 2005

Total Topics: 5
Total Comments: 15
egdcltd
#13 - Quote - Permalink
Posted Mar 10, 2006 - 3:23 AM:

Yes. Originally, the test file was named index.php, then I changed it to test.php. Currently, the index.php file is the file I described earlier.
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
#14 - Quote - Permalink
Posted Mar 13, 2006 - 12:37 PM:

It sounds like you're staying you're having the file call itself in an infinite loop. The index.php is supposed to be that of a WSN Links install.
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



This thread is closed, so you cannot post a reply.