View Single Post
  #331  
Old 05-01-2004, 01:21 AM
neocorteqz's Avatar
neocorteqz neocorteqz is offline
 
Join Date: May 2002
Location: Barefoot Bay Fl
Posts: 473
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lurk
I uploaded a new admincp/index.php file and i can't find the htl groups, what do i modify to re-add them? (Manually)
Find in File admincp/index.php around line 497

Code:
// cache nav prefs
	can_administer();

	construct_nav_spacer();
and Below that ADD

Code:
// [START HACK='Hack Tracking Log' AUTHOR='KuraFire' VERSION='1.00 Gold' CHANGEID= 1 ]
	// first we get the config_htl.php file that we need for some of this..
	require_once('./includes/config_htl.php');

	$thisnav = (!isset($_GET['hacksnav'])) ? 'vb' : 'hacks';

	construct_nav_option2($vbphrase['htl_cphome_refresh_current_menu'], 'index.php?do=nav' . iif($thisnav!='vb' AND $vboptions['htl_use_dual_nav'], '&amp;hacksnav=1'), '<br />');

	if ($vboptions['htl_use_dual_nav'])
	{
		if ($_REQUEST['hacksnav'] == 1)
		{
			define('QUICKSTOP', true);
			$thisnav = 'hacks';
		}
		construct_nav_option2(iif($thisnav=='vb', $vbphrase['htl_cphome_hacks_menu'], $vbphrase['htl_cphome_standard_vb_menu']), 
			'index.php?do=nav' . iif($thisnav=='vb', '&amp;hacksnav=1'), '<br />');
	}

	construct_nav_group($vbphrase['htl_cphome_menu_navigation']);
	construct_nav_spacer();

	if (!$vboptions['htl_use_dual_nav'])
	{
		// place this line lower in this section to have the hack menu items appear elsewhere
		build_hacknavs();
	}

	if (defined('QUICKSTOP'))
	{
		build_hacknavs();

		print_nav_panel();

		echo "</div>\n";
		// *************************************************

		define('NO_CP_COPYRIGHT', true);
		unset($DEVDEBUG);
		print_cp_footer();
		exit;
	}
// [END HACK='Hack Tracking Log' AUTHOR='KuraFire' VERSION='1.00 Gold' CHANGEID= 1 ]
Find in File includes/adminfunctions_navpanel.php around line 264

Code:
	<?php

	echo $controls . $_NAV . $_controls;
}
ADD Below that

Code:
// [START HACK='Hack Tracking Log' AUTHOR='KuraFire' VERSION='1.00 Gold' CHANGEID= 2 ]
// ###################### Start makenavoption 2#######################
// similar to the normal one, except it doesn't send you to the main frame.
// function granted to the HTL by trafix, copyright (C) trafix
function construct_nav_option2($title, $url, $extra = '')
{
	global $session, $options;
	static $sessionlink;
	
	if (!isset($options))
	{
		$options = array();
		if ($session['sessionurl'] == '')
		{
			$sessionlink = '';
		}
		else
		{
			$sessionlink = "&amp;s=$session[sessionhash]";
		}
	}

	$options[] = "\t\t<div class=\"navlink-normal\" onclick=\"location='$url$sessionlink';\" onmouseover=\"this.className='navlink-hover';\" onmouseout=\"this.className='navlink-normal'\"><a href=\"$url$sessionlink\" target=\"_self\" onclick=\"window.event.cancelBubble = true;\">$title</a>$_extra</div>\n";
}


// ###################### Start build_hacknavs ######################
// creates navpanel menu blocks for all hacks in the HTL that have this enabled
function build_hacknavs()
{
	global $DB_site;
	static $hackmenu;

	$get_hack_navs = $DB_site->query("SELECT menubits FROM " . TABLE_PREFIX . "hack WHERE (options & " . HTLSETTING_SHOWMENU . ") AND atstep=-1");

	while ($hackmenu = $DB_site->fetch_array($get_hack_navs))
	{
		construct_hack_nav($hackmenu['menubits']);
	}
}


// ###################### Start construct_hack_nav ##################
// takes $ser_data, which is a serialized array with info, and creates 
// a whole menu block item out of it :)
function construct_hack_nav($ser_data)
{
	global $vboptions;

	$prefix = ($vboptions['htl_prefix_titles']) ? $vboptions['htl_prefix_what'] : '';

	$data = unserialize($ser_data);

	if (sizeof($data) > 1)
	{
		$title = $data[0];
		unset($data[0]);
		foreach($data as $displayorder=>$arry)
		{
			construct_nav_option($arry['text'], $arry['url'], '<br />');
		}

		construct_nav_group($prefix . $title, '<hr />');
		construct_nav_spacer();
	}
}
// [END HACK='Hack Tracking Log' AUTHOR='KuraFire' VERSION='1.00 Gold' CHANGEID= 2 ]
Find in File includes/adminfunctions_template.php around line 3079 (Basically at the end of the file)

Code:
);
Add Below

Code:
// [START HACK='Hack Tracking Log' AUTHOR='KuraFire' VERSION='1.00 Gold' CHANGEID= 3 ]
if ($_SERVER['PHP_SELF'] == "/$admincpdir/template.php")
{
	require_once('./includes/config_htl.php');
	if ($vboptions['htl_use_auto_tgroups'] == 1)
	{
		$hack_tgroups = $DB_site->query("SELECT groupname, title FROM " . TABLE_PREFIX . "hack WHERE (options & " . HTLSETTING_SHOWTEMPLATEGROUP . ") AND atstep = -1 AND groupname != ''");

		while ($tgroup = $DB_site->fetch_array($hack_tgroups))
		{
			$name        = preg_replace('/[^a-z]/', '', strtolower($tgroup['groupname']));
			$only[$name] = $tgroup['title'];
		}
	}
}
// [END HACK='Hack Tracking Log' AUTHOR='KuraFire' VERSION='1.00 Gold' CHANGEID= 3 ]
These three things need to be done for it to show up in the AdminCP.
Already done the edits to
includes/adminfunctions_template.php
includes/adminfunctions_navpanel.php

Just do the Index.php edit. You can always access the Hack List by directly calling the script in your browser. and then the above steps would be found by running a test install, should be step 6 of 6.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01375 seconds
  • Memory Usage 1,791KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)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 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • showpost_complete