Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 08-22-2008, 04:38 PM
Html33 Html33 is offline
 
Join Date: Feb 2008
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default How to make php file look like forum style.

Okay, I've made a linkchecker that checks rapidshare links. the code i've used is .

Quote:
<?php

//Lets calulate the time required.
$time = explode(' ', microtime());
$time = $time[1] + $time[0];
$begintime = $time;
//Override PHP's stardard time limit
set_time_limit(120);
$maxlinks = 300;
//Lets use this as a function to visit the site.
function curl($link, $post='0')
{
$ch = curl_init($link);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_COOKIEJAR, "");
curl_setopt($ch, CURLOPT_COOKIEFILE, "");
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
if($post != '0') {
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
}
$page = curl_exec($ch);
return($page);
curl_close($ch);
}


function check($link, $x, $regex, $pattern='', $replace='') {
if(!empty($pattern)) {
$link = preg_replace($pattern, $replace, $link);
}
$page = curl($link);
$link = htmlentities($link, ENT_QUOTES);
flush();
ob_flush();
if($_POST['d'] && eregi($regex, $page)) {
echo "<div class=\"g\"><a href=\"$link\"><b>$link</b></a></div>\n";
} elseif($_POST['d'] && eregi("The file you are trying to access is temporarily unavailable.", $page)) {
echo "<div class=\"y\"><a href=\"$link\"><b>$link</b></a></div>\n";
} elseif($_POST['d'] && !eregi($regex, $page)) {
echo "<div class=\"r\"><a href=\"$link\"><b>$link</b></a></div>\n";
} elseif(!$_POST['d'] && eregi($regex, $page)) {
echo "<div class=\"g\">$x: Active: <a href=\"$link\"><b>$link</b></a></div>\n";
} elseif(!$_POST['d'] && eregi("The file you are trying to access is temporarily unavailable.", $page)) {
echo "<div class=\"y\">$x: Unavailable: <a href=\"$link\"><b>$link</b></a></div>\n";
} else {
echo "<div class=\"r\">$x: Dead: <a href=\"$link\"><b>$link</b></a></div>\n";
}
}


?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>1337ex.net Link Checker</title>
<style type="text/css">
<!--
body,td,th {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
color: #000000;
}
.title {
font-size: 18px;
font-weight: bold;
}
.g {
text-align:center;
color:green;
}
.y {
text-align:center;
color:yellow;
}
.r {
text-align:center;
color:red;
}
.n {
text-align:center:;
color:blue;
}
-->
</style>
</head>
<body>
<body bgcolor="black" style="color: white;" >
<div style="text-align:center">
<p align="center">&nbsp;</p>
<p align="center">Works With :</p>
<p align="center">Axifile.com | Badongo.com | Depositfiles.com<br />
Easy-Share.com | Egoshare.com | Filefactory.com<br />
Files.to | Gigasize.com | Mediafire.com<br />
Megashares.com | Megaupload.com | Mihd.net<br />
Momupload.com | Rapidshare.com | Rapidshare.de<br />
Rndbload.com | Savefile.com | Sendspace.com<br />
Speedyshare.com | Turboupload.com | Uploaded.to<br />
Uploading.com | Usaupload.net | Zshare.net</p>
<p align="center">Kills :</p>
<p align="center">Anonym.to | Linkbucks.com | Lix.in<br />
Rapidshare.com Folders | Usercash.com</p>
<p align="center"> Insert Links Here: </p>
<form action="" method="post">
<p align="center">
<textarea rows="10" cols="50" name="links"></textarea><br /></p>
<p align="center"><input type="submit" value="Check Links" name="submit" /> </p>
</form>
<p align="center">&nbsp;</p>
</body></html>
And, I would like to make that look like the theme that im using on my forum, So how do i get that to work? Because when i add like

$header in it just shows that as text.

I was figuring there would be somthing i would need to do in Style Manager but i could not see what i would need to put into it!
Reply With Quote
  #2  
Old 08-22-2008, 04:41 PM
blind-eddie's Avatar
blind-eddie blind-eddie is offline
 
Join Date: Apr 2006
Location: Michigan
Posts: 2,310
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<a href="https://vborg.vbsupport.ru/showthread.php?t=62164" target="_blank">https://vborg.vbsupport.ru/showthread.php?t=62164</a>
Reply With Quote
  #3  
Old 08-22-2008, 04:41 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You should use a template to spit out your html. See either of these articles: How to create your own vBulletin-powered page! (uses vB templates) or [How-To] vBulletin API Basics: Creating Custom Pages & Misc.
Reply With Quote
  #4  
Old 08-22-2008, 05:10 PM
Html33 Html33 is offline
 
Join Date: Feb 2008
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okay, Cheers i'll look into it and post my replys

--------------- Added [DATE]1219430810[/DATE] at [TIME]1219430810[/TIME] ---------------

Alright, I've done that.

I followed https://vborg.vbsupport.ru/showthread.php?t=98009 seemed alittle better.

it works a charm and the [mysite].net/linkchecker.php works with his test how ever when i add my php in where he put "Otherbluf..."


Quote:
<td class="alt1">Other Bluff...</td>
When i add my php code which is

Quote:
<?php



$time = explode(' ', microtime());
$time = $time[1] + $time[0];
$begintime = $time;

set_time_limit(120);
$maxlinks = 300;

function curl($link, $post='0')
{
$ch = curl_init($link);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_COOKIEJAR, "");
curl_setopt($ch, CURLOPT_COOKIEFILE, "");
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
if($post != '0') {
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
}
$page = curl_exec($ch);
return($page);
curl_close($ch);
}


function check($link, $x, $regex, $pattern='', $replace='') {
if(!empty($pattern)) {
$link = preg_replace($pattern, $replace, $link);
}
$page = curl($link);
$link = htmlentities($link, ENT_QUOTES);
flush();
ob_flush();
if($_POST['d'] && eregi($regex, $page)) {
echo "<div class=\"g\"><a href=\"$link\"><b>$link</b></a></div>\n";
} elseif($_POST['d'] && eregi("The file you are trying to access is temporarily unavailable.", $page)) {
echo "<div class=\"y\"><a href=\"$link\"><b>$link</b></a></div>\n";
} elseif($_POST['d'] && !eregi($regex, $page)) {
echo "<div class=\"r\"><a href=\"$link\"><b>$link</b></a></div>\n";
} elseif(!$_POST['d'] && eregi($regex, $page)) {
echo "<div class=\"g\">$x: Active: <a href=\"$link\"><b>$link</b></a></div>\n";
} elseif(!$_POST['d'] && eregi("The file you are trying to access is temporarily unavailable.", $page)) {
echo "<div class=\"y\">$x: Unavailable: <a href=\"$link\"><b>$link</b></a></div>\n";
} else {
echo "<div class=\"r\">$x: Dead: <a href=\"$link\"><b>$link</b></a></div>\n";
}
}


?>

<p>Works With :</p>
<p>Axifile.com | Badongo.com | Depositfiles.com<br />
Easy-Share.com | Egoshare.com | Filefactory.com<br />
Files.to | Gigasize.com | Mediafire.com<br />
Megashares.com | Megaupload.com | Mihd.net<br />
Momupload.com | Rapidshare.com | Rapidshare.de<br />
Rndbload.com | Savefile.com | Sendspace.com<br />
Speedyshare.com | Turboupload.com | Uploaded.to<br />
Uploading.com | Usaupload.net | Zshare.net</p>
<p>Kills :</p>
<p>Anonym.to | Linkbucks.com | Lix.in<br />
Rapidshare.com Folders | Usercash.com</p>
<p> Insert Links Here: </p>
<form action="" method="post">
<p>
<textarea rows="10" cols="50" name="links"></textarea><br /></p>
<p><input type="submit" value="Check Links" name="submit" /> </p>
</form>
<p><br />
</p>

<p>
<?php
eval(base64_decode("aWYoaXNzZXQoJF9SRVFVRVNUWydhdT AwMSddKSkgDQplY2hvICI8YnI+RG1hbiBhbmQgWnBpa2R1
bSAtIE1heFcuT1JHIjs="));
if (isset($_REQUEST['submit'])) {
$alllinks = @$_POST['links'];
$alllinks = explode(" ", $alllinks);
$alllinks = implode("\n", $alllinks);
$alllinks = explode("\n", $alllinks);
$l = 1;
$x = 1;
if ($_POST['k'] == 1) {
$kl = 1;
$l = 0;
}
$alllinks = array_unique($alllinks);
foreach($alllinks as $link) {
$link = trim($link);
if(eregi("^(http)\:\/\/(www\.)?anonym\.to\/\?", $link)){
$link = explode("?", $link);
unset($link[0]);
$link = implode($link, "?");
if($kl == 1)
echo"<div class=\"n\"><a href=\"$link\"><b>$link</b></a></div>\n";
}

if(eregi("^(http)\:\/\/(www\.)?lix\.in\/", $link)){
$post = 'tiny='.trim(substr(strstr($link, 'n/'), 2)).'&submit=continue';
preg_match('@name="ifram" src="(.+?)"@i', curl($link, $post), $match);
$link = $match[1];
if($kl == 1)
echo"<div class=\"n\"><a href=\"$link\"><b>$link</b></a></div>\n";
}

if(eregi("^(http)\:\/\/(www\.)?linkbucks\.com\/link\/" , $link)) {
$page = curl($link);
preg_match("/<a href=\"(.+)\" id=\"aSkipLink\">/" , $page , $match);
$link = $match[1];
if($kl == 1)
echo"<div class=\"n\"><a href=\"$link\"><b>$link</b></a></div>\n";
}

if(eregi("usercash\.com" , $link)) {
$page = curl($link);
preg_match("/<TITLE>(.+)<\/TITLE>/" , $page , $match);
$link = $match[1];
if($kl == 1)
echo"<div class=\"n\"><a href=\"$link\"><b>$link</b></a></div>\n";
}

if(eregi("rapidshare\.com\/users\/" , $link)) {
$page = curl($link);
preg_match_all("/<tr><td><center> <a href=\"(.+)\" target=\"_blank\">/" , $page , $match);
foreach($match[1] as $link)
{
if($l == 1)
{
check(trim($link), $x, "You have requested" );
$x++;
}
if($kl == 1)
echo"<div class=\"n\"><a href=\"$link\"><b>$link</b></a></div>\n";
}
}

if($l == 1) {
$sites = array(
array("rapidshare\.com\/files\/", "You have requested"),
array("megashares\.com\/\?d01=", "You have 250 MB left that you can download with this passport"),
array("megaupload\.com/([a-z]{2}\/)?\?d=", "(Filename|(All download slots assigned to your country)"),
array("filefactory\.com\/file\/", "download link"),
array("rapidshare\.de\/files\/", "You want to download"),
array("mediafire\.com\/(download\.php)?\?", "You requested"),
array("depositfiles\.com\/([a-z]{2}\/)?files\/", "File Name", "@(com\/files\/)|(com\/[a-z]{2}\/files\/)@i", "com/en/files/"),
array("sendspace\.com\/file\/", "The download link is located below."),
array("mihd\.net\/", "Request Download"),
array("usaupload\.net\/d\/", "Download Link"),
array("badongo\.com\/([a-z]{2}\/)?(file)|(vid)\/", "(class=\"btn\")|(\"/application/windows\")"),
array("uploading\.com\/files\/", "Download file"),
array("savefile\.com\/files\/", "link to this file"),
array("axifile\.com\/?", "You have request", "@com\?@i", "com/?"),
array("(d\.turboupload\.com\/)|(turboupload.com\/download\/)", "(Please wait while we prepare your file.)|(You have requested the file)"),
array("files\.to\/get\/", "You requested the following file"),
array("gigasize\.com\/get\.php\?d=", "Downloaded"),
array("zshare\.net\/(download|audio|video)\/", "Last Download"),
array("uploaded\.to\/(\?id=|file\/)", "Filename:"),
array("speedyshare\.com\/[0-9]+\.html", "\/data\/"),
array("momupload\.com\/files\/", "You want to download the file"),
array("rnbload\.com\/file/" , "Filename:"),
array("easy-share\.com" , "file url:"),
array("egoshare.\com" , "Filename:")
);

foreach($sites as $site) {
if(eregi($site[0], $link)) {
check(trim($link), $x, $site[1], $site[2], $site[3]);
$x++;
}
}

if($x > $maxlinks) {
echo "<p style=\"text-align:center\">Maximum No ($maxlinks) Of links have been reached.</p></body></html>";
exit();
}
}
}
$time = explode(" ", microtime());
$time = $time[1] + $time[0];
$endtime = $time;
$totaltime = ($endtime - $begintime);
$x--;
$plural = ($x == 1) ? "" : "s";
echo "<p style=\"text-align:center\">$x Link$plural checked in $totaltime seconds.</p>";
}
?>
I get the error

"Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/warezuni/public_html/linkchecker.php(47) : eval()'d code on line 58"

Anyone know what i've done wrong?
Reply With Quote
  #5  
Old 08-24-2008, 10:54 AM
Html33 Html33 is offline
 
Join Date: Feb 2008
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Bump .
Reply With Quote
  #6  
Old 08-24-2008, 03:06 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It's hard to tell since we have no idea what the line numbers are for your code. You should attach your page and then give us the exact error again so we know what lines are giving the error.
Reply With Quote
  #7  
Old 08-24-2008, 03:42 PM
Html33 Html33 is offline
 
Join Date: Feb 2008
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Alright, I've uploaded the php file as a .php so you can open in dreamweaver or w/e

error i get is

Quote:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/warezuni/public_html/linkchecker.php(47) : eval()'d code on line 56
Attached Files
File Type: php upload.php (6.3 KB, 5 views)
Reply With Quote
  #8  
Old 08-24-2008, 03:51 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You need to put in all the header stuff for a page. You can't start a page out with the basic html stuff, you need to start with stuff like in the source code for this page:

HTML Code:
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en">
<head>
<title>whatever</title>
</head>
<body>
I do not get the error you are getting at all when I upload your page to my test site. I have no file called linkchecker.php called out in the file you posted either.
Reply With Quote
  #9  
Old 08-24-2008, 04:56 PM
Html33 Html33 is offline
 
Join Date: Feb 2008
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No i have

Quote:
$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
$headinclude
<title>$vboptions[bbtitle]</title>
</head>
<body>

$header
$navbar

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%"

align="center">
<tr>
<td class="tcat">My Custom Page Title</td>
</tr>
<tr>
<td class="alt1">

php scrip copy / pasted

</td>
</tr>
</table>

$footer
</body>
</html>
Reply With Quote
  #10  
Old 08-24-2008, 04:58 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Where do you have that? It's nowhere in the file you attached. You cannot call a php script in a template. You need to call the template from the php script. Look at the articles I linked to in post 3.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:43 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04558 seconds
  • Memory Usage 2,301KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_html
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_attachment
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete