I'm not a php or html programmer. I know c++. I'm trying to help a friend on his site. How would I use the theme he currently has on his site to make a different page. EX how would I take the theme on
http://viewingnetwork.com/ and apply it to page
http://viewingnetwork.com/membersites.php?action=add
Other Facts. This is a new installation of 1.6.2.
Thanks for your help. (or at least your time in reading this post)
Edit: it's integrated with mybb so you will have to log in
username: testu
pasword: mybbtest
Mate, what is that new page, i just get a 'you are not logged in' line on a blank white page
ah it's intergrated with mybb.
you will have to log in on viewingnetwork.com first
username: testu
pasword: mybbtest
paste the code you are trying to enter?
<?php
define("IN_MYBB", 1);
require_once('./global.php');
//if a user is logged in show sites
if($mybb->user['uid'] != 0)
{
if($mybb->input['action']=='add')
{
//if the data is being posted
if($mybb->input['submit']=='Add Site')
{
//checks to make sure valid numeric values
if(is_numeric($mybb->input['delay']) && is_numeric($mybb->input['views']) && is_numeric($mybb->input['IPlimit']) && is_numeric($mybb->input['IPrenew']) && is_numeric($mybb->input['clickProbability']))
{
//escapes strings so no hacking
$url = $db->escape_string($mybb->input['url']);
$clickID = $db->escape_string($mybb->input['clickID']);
$userString = $db->escape_string($mybb->input['userString']);
$referalURL = $db->escape_string($mybb->input['referalURL']);
$queryCredits = "SELECT credits FROM ".TABLE_PREFIX."users WHERE uid=".$mybb->user['uid']." LIMIT 1";
$tmp = $db->fetch_array($db->query($queryCredits));
$credits = $tmp['credits'];
$multi = $mybb->input['delay'];
echo($credits);
if($mybb->input['delay']==0)
{
$multi = 1;
}
$newCredits = $credits-($multi*$mybb->input['views']);
if($newCredits>=0)
{
//update credits in user table
$queryUser = "UPDATE ".TABLE_PREFIX."users SET credits=".$newCredits." WHERE uid=".$mybb->user['uid']." LIMIT 1";
if($db->query($queryUser))
{
//add site to database
$querySites = "INSERT INTO vn_sites
(uid,url,delay,views,IPlimit,IPrenew,clickID,clickProbability,userString,referalURL)
VALUES
(".$mybb->user['uid'].",'".$url."',".$mybb->input['delay'].",".$mybb->input['views'].",".$mybb->input['IPlimit'].",".$mybb->input['IPrenew'].",'".$clickID."',".$mybb->input['clickProbability'].",'".$userString."','".$referalURL."')";
//execute query
if($db->query($querySites))
{
echo("Site has been added.");
}
//if the query fails and the site cannot be added for some reason refund the user their credits.
else
{
$queryUser = "UPDATE ".TABLE_PREFIX."users SET credits=".$credits." WHERE uid=".$mybb->user['uid']." LIMIT 1";
$db->query($queryUser);
echo("ERROR: could not add site");
}
}
}
else
{
echo("Error: you need ".($newCredits*-1)." more credits.");
}
}
}
//if data has not been specified show form
else
{
echo('<form method="post" action="membersites.php?action=add" name="AddSite">
Url <br><input name="url"><br><br>
View Time <br><input name="delay" value="0"> seconds (leave as 0 to navigate away from page as soon as it loads)<br><br>
Views <br><input name="views" value="0"><br><br>
Views Per IP Address<br><input name="IPlimit" value="0"> (leave as 0 for unlimited views per IP)<br><br>
Renew IP Address List every <br><input name="IPrenew" value="0"> minutes (leave as 0 if site should never renew IPs)<br><br>
HTML element ID <br><input name="clickID">(Generates a click on the HTML element when the page loads, leave blank for no click to be generated)<br><br>
Click Probability <br><input name="clickProbability" value="10">% (the probability that the click will occur 0-100%)<br><br>
Specify Browser user string to use when viewing your webpage<br><textarea cols="50" rows="5" name="userString"></textarea>(Leave blank if you do not know what this is)<br><br>
Referal Url <br><input name="referalURL"> leave blank if you do not know what this means<br><br>
<button value="Add Site" name="submit">Add Site</button><br>
</form>');
}
}
elseif($mybb->input['action']=='delete')
{
if(is_numeric($mybb->input['id']))
{
$query = "DELETE FROM vn_sites WHERE id=".$mybb->input['id']." LIMIT 1";
$db->query($query);
echo("Deleted site from database");
}
else
{
echo("Error: no site specified for deletion.");
}
}
elseif($mybb->input['action']=='view' || !isset($mybb->input['action']))
{
echo("<table border=1>");
echo("<tr>");
echo("<td>URL</td>");
echo("<td>View Time (sec)</td>");
echo("<td>Views Left</td>");
echo("<td>Views Per IP</td>");
echo("<td>IP Reset Interval (min)</td>");
echo("<td>Last IP Reset</td>");
echo("<td>Click HTML Element ID</td>");
echo("<td>Click Probability</td>");
echo("<td>User String</td>");
echo("<td>Referal URL</td>");
echo("<td>Last Viewed</td>");
echo("<td>Total Views</td>");
echo("<td>Total Clicks</td>");
echo("<td></td>");
echo("</tr>");
//query gets all sites this user owns
$query = "SELECT * FROM vn_sites WHERE uid=".$mybb->user['uid']." ";
$query = $db->query($query);
while($sites = $db->fetch_array($query))
{
echo("<tr>");
echo("<td>".$sites['url']."</td>");
echo("<td>".$sites['delay']."</td>");
echo("<td>".$sites['views']."</td>");
echo("<td>".$sites['IPlimit']."</td>");
echo("<td>".$sites['IPrenew']."</td>");
echo("<td>".$sites['lastRenew']."</td>");
echo("<td>".$sites['clickID']."</td>");
echo("<td>".$sites['clcikProbability']."</td>");
echo("<td>".$sites['userString']."</td>");
echo("<td>".$sites['referalURL']."</td>");
echo("<td>".$sites['lastViewed']."</td>");
echo("<td>".$sites['totalViews']."</td>");
echo("<td>".$sites['totalClicks']."</td>");
echo("<td></td>");
echo("</tr>");
}
echo("</table>");
}
}
else
{
echo("You are not logged in.");
}
?>
Where can i find the html version of the page? I don't mind changing it by hand.
My sister's sick. Going to run to the store to get her medicine. Be back in a few. Thanks guys