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

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 05-10-2012, 06:57 AM
Wizza Wizza is offline
 
Join Date: Mar 2012
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Custom Page

I wonder if anyone can help me, I'm looking to create some custom pages in VB4 or even in the CMS.

I'm following this tutorial:

http://www.modmysite.com/other-3rd-p...ions/10619.htm

However I have no idea how to turn a php script into a page in VB4.

I understand that there are parts of php code that needs to be changed in VB4 so could you help me and change the following code into code I can put into a template and use?

Code:
<?php
	include('scripts/linkpopularity.class.php');
	$linkpop = New LinkPOP();
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
	<title>Check your Link Popularity</title>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
	<link href="scripts/style.css" rel="stylesheet" type="text/css" />
</head>
<body >

<div id="container">
	<div id="main">
		<p>Once submitted, please be patient as this process can take upto 30 seconds.</p>
		<form id="frm" method="post" action="<?= $PHP_SELF; ?>">
		<input type="hidden" name="mr" value="<?= $today_date; ?>" />
			<table cellpadding="0" cellspacing="0">
				<tr>
					<td width="1">http://</td>
					<td width="1"><input id="url" class="check_box" type="text" name="url" value="ex: www.yourdomain.com" onfocus="value = '';" /></td>
					<td width="1" class="button"><input type="submit"  style="height: 20px;" class="check_button" value="submit" /></td>
					<td>&nbsp;</td>
				</tr>
				<tr>
					<td colspan="4" class="engines">
						<input type="checkbox" name="engines[]" value="google" checked="checked">Google
						&nbsp;&nbsp;<input type="checkbox" name="engines[]" value="bing" checked="checked">Bing
						&nbsp;&nbsp;<input type="checkbox" name="engines[]" value="yahoo" checked="checked">Yahoo
						&nbsp;&nbsp;<input type="checkbox" name="engines[]" value="alltheweb" checked="checked">AlltheWeb
						&nbsp;&nbsp;<input type="checkbox" name="engines[]" value="altavista" checked="checked">Altavista
						&nbsp;&nbsp;<input type="checkbox" name="engines[]" value="ask" checked="checked">Ask
						&nbsp;&nbsp;<input type="checkbox" name="engines[]" value="alexa" checked="checked">Alexa Rating
						&nbsp;&nbsp;<input type="checkbox" name="engines[]" value="dmoz" checked="checked">DMOZ
					</td>
				</tr>
			</table>
		</form>




<?php
if (isset($_POST['url']) && $_POST['url'] != "" )
{
	$linkpop->allowed_engines = $_POST['engines'];
	$linkpop->GetData($_POST['url']);
?>
		<h2>Your Link Popularity results</h2>
		<table cellspacing="0" cellpadding="0" id="linkpop">
			<tr class="subtitle" >
				<td colspan="10"><?=$linkpop->domain; ?></td>
			</tr>

		<tbody>
			<tr class="engine-bar">
<?php
			foreach($linkpop->results as $subdata)
			{
				print '<td>'.$subdata['name'].'</td>';
			}
?>
			</tr>

			<tr class="result-line">
<?php
			foreach($linkpop->results as $subdata)
			{
?>
				<td>
<?php
				if (is_numeric($subdata['value'])){
					echo '<span class="result-value">'.number_format($subdata['value'],0,'.',',').'</span>';
				} else {
					echo '<span class="result-value">'.strtolower($subdata['value']).'</span>';
				}
				if ($subdata['name'] != 'invalid url'){
					print '<br><a class="check" href="'.$subdata['url'].'">(check)</a>';
				}
?>
				</td>
<?php
			}
?>
			</tr>

		<?php
			if (is_array($linkpop->directories))
			{
		?>

<?php
			foreach($linkpop->directories as $subdata)
			{
?>
		<tr>
			<td><?=$subdata['name']; ?></td>
			<td style="text-align: right; padding-right: 3px;">
<?php
				if (is_numeric($subdata['value'])) { echo number_format($subdata['value'],0,'.',',');
				} else { echo strtolower($subdata['value']); }
?>
			<a href="<?=$subdata['url']; ?>">(check)</a></td>
		</tr>
<?php
				}
			}
?>
		</tbody>
		<tr class="total">
			<td>Total</td>
			<td style="text-align: right;"><?=number_format($linkpop->total,0,'.',','); ?></td>
			<td colspan="10">&nbsp;</td>
		</tr>
<?
}
?>

			<tr>
				<td colspan="10" style="margin-left:115px;"><span style="font-size:10px;">Powered by </span><a href="http://www.siteexpert.net/" target="_blank"  style="font-size:10px; color:#666666;">Site Expert</a></td>
			</tr>
		</table>

	</div>
</div>
</body>
</html>
Obviously the head and title and what not can go as it will be using the skin.
Reply With Quote
 


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 01:52 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03577 seconds
  • Memory Usage 2,339KB
  • Queries Executed 13 (?)
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)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (4)post_thanks_box
  • (4)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit_info
  • (4)postbit
  • (4)postbit_onlinestatus
  • (4)postbit_wrapper
  • (1)showthread_list
  • (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_threadedmode.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_threaded
  • showthread_threaded_construct_link
  • 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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete