PDA

View Full Version : need help with custom mod/hack


msalman
06-26-2007, 04:51 PM
hey all,

i'm working on a mod for my vb board. I've created few templates and few php files, i've been able to connect them together. Now on my 1st page, i got a table that lists bunch of links. Now i want to open the information of the selected link in new page and update navbits according to selection. I've setup the $_REQUEST['do'] conditional statement but i don't know how to check which link was selected and update navbits accordingly. Any help would really really appreciate.

Here's code for my php file.

quran.php
<?php

// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'quran'); // change this depending on your filename

// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array(

);

// get special data templates from the datastore
$specialtemplates = array(

);

// pre-cache templates used by all actions
$globaltemplates = array(
'quran',
'quran_indexbits',
'quran_displaybits',
);

// pre-cache templates used by specific actions
$actiontemplates = array(

);

// ######################### REQUIRE BACK-END ############################
require_once('./global.php');
require_once (DIR . '/includes/functions_quran.php');

// ################################################## #####################
// ######################## START MAIN SCRIPT ############################
// ################################################## #####################

$arrayIndex = displayIndex();
unset($index);
for ($row = 0; $row < count($arrayIndex); $row++) {

$index_col['chpNo'] = $arrayIndex[$row]['chpNo'];
$index_col['chpName'] = $arrayIndex[$row]['chpName'];
$index_col['verses'] = $arrayIndex[$row]['verses'];

eval('$index .= "' . fetch_template('quran_indexbits') . '";');

}

if ($_REQUEST['do'] == 'displaysura')
{
$navbits = array();
$navbits[$parent] = 'Test';
$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('quran_displaybits') . '");');
}

$navbits = array();
$navbits[$parent] = 'Glorious Quran';
$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('quran') . '");');

?>

Here's code for my 3 templates

quran_indexbits
<tr>
<td class="alt1" align="center">$index_col[chpNo]</td>
<td class="alt1" align="center"><a href = "quran.php?do=displaysura">$index_col[chpName]</a></td>
<td class="alt1" align="center">$index_col[verses]</td>
</tr>

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

$navbar

<table width = "100%">
<tr>
<script type="text/javascript">
//specify path to your external page:
var iframesrc="/forums/quran_display.php";

document.write('<td id="frmttr" class=ddl width="50%" height =100% align =right><iframe src="'+iframesrc+'" name="frmTran1" height =100% onload="SetStatus()" enableviewstate =false scrolling=auto frameborder=yes marginheight =0 marginwidth =0 width="100%" bordercolor ="white"></iframe></td>');
document.write('<td id="frmtsc" class=ddl width="50%" height =100% align =right><iframe src="'+iframesrc+'" name="frmTran2" height =100% onload="SetStatus()" enableviewstate =false scrolling=auto frameborder=yes marginheight =0 marginwidth =0 width="100%" bordercolor =white></iframe></td>');

</script>

</tr>
</table>

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

$navbar

<table class='tborder' cellpadding='$stylevar[cellpadding]' cellspacing='$stylevar[cellspacing]' border='0' width='100%' align='center'>

<tr align ="center" >
<td class="tcat" colspan="8"><strong>$vbphrase[quran_index_title]</strong></td>
</tr>
<tr>
<td class="thead" align ="center">$vbphrase[quran_chpNo]</td>
<td class="thead" align ="center">$vbphrase[quran_chpName]</td>
<td class="thead" align ="center">$vbphrase[quran_verses]</td>
</tr>

$index
<tr align ="center">
<td class="tfoot" colspan="8"><div class="smallfont">$vbphrase[quran_footer]</div></td>
</tr>

</table>

$footer
</body>
</html>

Please someone help me with this or give me some hints, thanking in advance !

nevermind, i figured out myself, thanks though