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 06-26-2007, 04:51 PM
msalman msalman is offline
 
Join Date: Jun 2007
Location: islamic-life.com
Posts: 81
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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
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 03:30 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.03694 seconds
  • Memory Usage 2,163KB
  • Queries Executed 11 (?)
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
  • (4)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete