Thread: Help me please
View Single Post
  #6  
Old 07-05-2008, 06:09 PM
vuiveclub vuiveclub is offline
 
Join Date: Dec 2006
Posts: 78
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I can't tell you what I mean because I am too bad in English

But today I can show you what I need to do.

Please browser this page: http://www.mfgz.co.uk/forum/nmaps.php?do=cat&cat_id=1

You can see this ID category is 1 and category name is Site News (this is eval template)

Now I need some code which I can add that category name to <title> tag in output template.

The code of this script
PHP Code:
// #####################################################################
// ############## VIEWING CATEGORIES   ########################################
// #####################################################################
if ($do == 'cat')
{
$cat_id2 $vbulletin->input->clean_gpc('g''cat_id'TYPE_INT);
$cat_id3 $vbulletin->input->clean_gpc('p''cat_id'TYPE_INT);

    
$cat_id = (isset($cat_id2) ? trim($cat_id2) : (isset($cat_id3) ? trim($cat_id3) : ''));
    
    
// Count all log entries 
    
$news_count $db->query_first("SELECT COUNT(*) AS `news_count` FROM `" TABLE_PREFIX "nmaps_news` WHERE `auth_id`='" $vbulletin->userinfo['userid'] . "' ");  
    
    
// Make sure all these variables are cool 
    
sanitize_pageresults($news_count['news_count'], $pagenumber$perpage100$settings['max_stories']); 
    
    
// Default lower and upper limit variables 
    
$limitlower = ($pagenumber 1) * $perpage 1
    
$limitupper $pagenumber $perpage
    if (
$limitupper $news_count['news_count']) 
    { 
        
// Too many for upper limit 
        
$limitupper $news_count['news_count']; 
        if (
$limitlower $news_count['news_count']) 
        { 
            
// Too many for lower limit 
            
$limitlower $news_count['news_count'] - $perpage
        } 
    } 
    if (
$limitlower <= 0
    { 
        
// Can't have negative or null lower limit 
        
$limitlower 1
    }
    
    
$cat_query $vbulletin->db->query_read("SELECT * FROM " TABLE_PREFIX "nmaps_cats WHERE `cat_id`='$cat_id' LIMIT 1");
    while (
$cat_title $vbulletin->db->fetch_array($cat_query))
    {
        
$cat_name $cat_title['cat_name'];
    
        
$cat_stories $vbulletin->db->query_read("
                            SELECT news.*, author.* FROM " 
TABLE_PREFIX "nmaps_news as news 
                            LEFT JOIN " 
TABLE_PREFIX "user as author ON (author.userid = news.auth_id)
                            WHERE `cat_id`='
$cat_id' ORDER BY post_date DESC LIMIT " . ($limitlower 1) . ", $perpage"); 
        while (
$cat_news $vbulletin->db->fetch_array($cat_stories))
        {
            
$cat_news_story $cat_news['news_title'];
            
$news_id $cat_news['news_id'];
            
$cat_news_auth_id $cat_news['auth_id'];
            
$cat_news_auth $cat_news['username'];
            
$cat_news_message $cat_news['message'];
            
            
$date vbdate($vbulletin->options['dateformat'], $cat_news['post_date']);
            
$time vbdate($vbulletin->options['timeformat'], $cat_news['post_date']);
            
            
$pagenav construct_page_nav($pagenumber$perpage$news_count['news_count'], "$nmaps_file?" $vbulletin->session->vars['sessionurl'] . 'do=cat');
            
            eval(
'$pg_cat_bit .= "' fetch_template("nmaps_pg_cat_bit") . '";');
        }

            
$navbits = array();
            
$navbits["$nmaps_file"] = $nmaps_title
            
$navbits[$parent] = $vbphrase['nmaps_news']; 
            
$navbits construct_navbits($navbits); 
            eval(
'$navbar = "' fetch_template('navbar') . '";'); 
            
            eval(
'$left_col = "' fetch_template('nmaps_col_left') . '";');
            eval(
'$right_col = "' fetch_template('nmaps_col_right') . '";');
            eval(
'print_output("' fetch_template('nmaps_pg_cat') . '");');
        
    }

Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01269 seconds
  • Memory Usage 1,835KB
  • 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
  • (1)bbcode_php
  • (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