Control Panel
Login to Begin to Talk!





Click Here to Register!
Advertisements



Go Back   Site Sift Forums > Site-Sift > Mods

 
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-26-2007, 02:58 AM
tez tez is offline
Clueless
 
Join Date: Sep 2006
Posts: 22
Default Changing titles on pages..?

Could anyone tell me how i can add a custom title to a page please?
  #2  
Old 05-17-2007, 08:24 PM
411notes 411notes is offline
Just Registered
 
Join Date: May 2007
Posts: 4
Default

I certainly don't have the PHP coding to accomplish what you need, but the Title tags are currently controlled here:

/include/myfunctions.ini.php

Here's the code you'll have to figure out... You might also need to create a field in the DB if you plan to customize each page's Title. It's probably better to create a rule.

PHP Code:
 #getBCrumTitle -- return bread crum style for title (recursive)
/* int $id, mysql connection $myconn */
function getBCrumTitle($id,$myconn){
    
$sql "select * from categories where id = '" $id "'";
    
$results mysql_query($sql,$myconn) or die(mysql_error());
    while(
$category mysql_fetch_assoc($results)){
        
getBCrumTitle($category['fatherID'],$myconn);
        print 
' » '.$category['title'];
    }
//end while
}//end function


#getMetaTags -- print meta tags based on current page location
/* string $curloc */
function getMetaTags($curloc,$myconn){
    
//fetch settings
    
$settings = (mysql_fetch_assoc(mysql_query("select * from settings where id = '1'",$myconn)));
    
    switch(
$curloc){//pending current location
        
case 'detail':
        
$title " information page";
        
$sql "select * from pages where id = '" $_REQUEST['id'] . "'";
        break;
        case 
'subcat':
        
$title " " $settings['title'];
        
$sql "select * from categories where id = '" $_REQUEST['id'] . "'";
        break;
        default:
        
$sql "select * from settings where id = '1'";
        break;
    }
//end switch
    
    
    
$results mysql_query($sql,$myconn) or die(mysql_error());
    
$page mysql_fetch_assoc($results);
    
    if(
$settings['bcTitle'] == '1' $curloc == 'subcat'){
        print 
'<title>'.$title.' ';
        
GetBCrumTitle($page['id'],$myconn);
        if (
$_REQUEST['pageNum_pages'] > 1) {
            print 
'&nbsp;&raquo;&nbsp;Page&nbsp;'.$_REQUEST['pageNum_pages'];
        }
        print 
'</title>';
    }
    else
//print meta tags
        
print '<title>'.$page['title'].$title.'</title>';
    
    if(
$page['keywords'] != '')
        print 
'<meta name="keywords" content="'.$page['keywords'].'">';
    else
        print 
'<meta name="keywords" content="'.$page['title'].'">';
            
    print 
'<meta name="description" content="'.$page['description'].'">';
    
    
}
//end function 


If you figure out how to edit all of this effectively, do share
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump



All times are GMT -7. The time now is 11:22 AM.


Powered by: vBulletin Version 3.0.7
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Site Sift Media, Inc.