vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   need help with custom mod/hack (https://vborg.vbsupport.ru/showthread.php?t=150730)

msalman 06-26-2007 04:51 PM

need help with custom mod/hack
 
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
Code:

<?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
Code:

<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
Code:

$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
Code:

$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


All times are GMT. The time now is 05:27 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.01568 seconds
  • Memory Usage 1,724KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (1)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete