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?
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
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.
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.
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.
Comments on Voting script
Member
Usergroup: Customer
Joined: May 06, 2005
Total Topics: 5
Total Comments: 15
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?
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
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.
Member
Usergroup: Customer
Joined: May 06, 2005
Total Topics: 5
Total Comments: 15
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.
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
So... either the page you pass it to understands the value you pass or it doesn't, depending on how you make this page.
Member
Usergroup: Customer
Joined: May 06, 2005
Total Topics: 5
Total Comments: 15
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
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
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.
Member
Usergroup: Customer
Joined: May 06, 2005
Total Topics: 5
Total Comments: 15
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?
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
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.
Member
Usergroup: Customer
Joined: May 06, 2005
Total Topics: 5
Total Comments: 15
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?
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
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.
Member
Usergroup: Customer
Joined: May 06, 2005
Total Topics: 5
Total Comments: 15
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
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
Well do you actually have an index.php in that directory where you're placing this file?
Member
Usergroup: Customer
Joined: May 06, 2005
Total Topics: 5
Total Comments: 15
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.
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
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.