1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Dynamic Titles

Discussion in 'PHP' started by wvcaudill2, Jun 11, 2009.

  1. wvcaudill2

    wvcaudill2 Peon

    Messages:
    176
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #21
    I dont think I have modified the algorithm. In fact, I dont think I have ever seen it. What file(s) can this be found in?
     
    wvcaudill2, Jun 13, 2009 IP
  2. Social.Network

    Social.Network Member

    Messages:
    517
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    35
    #22
    includes\global.php (lines 789 through 826).
     
    Social.Network, Jun 13, 2009 IP
  3. wvcaudill2

    wvcaudill2 Peon

    Messages:
    176
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #23
    Wow, I didnt even notice that was there! Well, that pretty much solves my dynamic titles problem. Except for one thing.

    I tried to change the code to make it more to my likeing, and now im getting this error:

    The code is below:

    	// title of the page
    	$glob['rss'] = '';
    	
    	if(isset($index_page)) {
    		$glob['title'] = 'Photoshop tutorials, Flash tutorials, and more! Newtuts Tutorial Search';
    		$glob['rss'] = '<link rel="alternate" type="application/rss+xml" title="'.COMPANY_NAME.' - Latest Tutorials" href="'.HTTP_SERVER.'rss.php?do=latest" />';
    	}elseif (isset($contact_page)) {
    		$glob['title'] = COMPANY_NAME' - Contact Us';
    	}elseif (isset($help_page)) {
    		$glob['title'] = COMPANY_NAME' - Help';
    	}elseif (isset($read_tutorial_page)) {
    		$glob['title'] = $read_tutorial['title'];
    	}elseif (isset($submit2_page)) {
    		$glob['title'] = COMPANY_NAME.' - Submit Tutorials';
    	}elseif (isset($sourcesite_page)) {
    		$glob['title'] = .'Tutorials from '.$glob['sourcesite'];
    		$glob['rss'] = '<link rel="alternate" type="application/rss+xml" title="'.COMPANY_NAME.' - Tutorials from " href="'.HTTP_SERVER.'rss.php?do=sourcesite&source='.$glob['sourcesite'].'" />';
    	}elseif (isset($submit_page)) {
    		$glob['title'] = COMPANY_NAME.' - Submit Tutorials';
    	}elseif (isset($tutorials_page)) {
    		$glob['title'] = COMPANY_NAME.' - Browse Tutorials';
    		$glob['rss'] = '<link rel="alternate" type="application/rss+xml" title="'.COMPANY_NAME.' - Latest Tutorials" href="'.HTTP_SERVER.'rss.php?do=latest" />';
    	}elseif (isset($view_tutorials_page)) {
    		if($glob['cur_sub_name'] == 'All') {
    			$glob['title'] = '.$glob['cur_cat_name'].' Tutorials';
    			$glob['rss'] = '<link rel="alternate" type="application/rss+xml" title="'.$glob['cur_cat_name'].'' Tutorials'" href="'.HTTP_SERVER.'rss.php?do=cat&cat='.$glob['cur_cat_name'].'" />';
    		}else{
    			$glob['title'] = $glob['cur_sub_name'];
    			$glob['rss'] = '<link rel="alternate" type="application/rss+xml" title="'.$glob['cur_sub_name'].'' Tutorials'" href="'.HTTP_SERVER.'rss.php?do=subcat&cat='.$glob['cur_cat_name'].'&subcat='.$glob['cur_sub_name'].'" />';
    		}
    	}elseif (isset($users_page)) {
    		$glob['title'] = COMPANY_NAME.' - '.$user['username'].'\'s Profile Page';
    	}elseif (isset($register_page)) {
    		$glob['title'] = COMPANY_NAME.' - Register';
    	}elseif (isset($tutorial_out_page)) {
    		$glob['title'] = $glob['tutorial_out_title'];
    	}else{
    		$glob['title'] = 'Photoshop tutorials, Flash tutorials, and more! Newtuts Tutorial Search';
    	}
    PHP:
    Any ideas why im getting this error?
     
    wvcaudill2, Jun 14, 2009 IP
  4. Social.Network

    Social.Network Member

    Messages:
    517
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    35
    #24
    It appears that you have a couple of errors, see abbreviated code below:

    Add code in BLUE and delete code in RED.

    
        }elseif (isset($contact_page)) {
            [B]$glob['title'] = COMPANY_NAME[COLOR="Blue"].[/COLOR]' - Contact Us';[/B]
    
        }elseif (isset($help_page)) {
            [B]$glob['title'] = COMPANY_NAME[COLOR="Blue"].[/COLOR]' - Help';[/B]
    
        }elseif (isset($sourcesite_page)) {
            [B]$glob['title'] = [COLOR="Red"].[/COLOR]'Tutorials from '.$glob['sourcesite'];[/B]
    
        }elseif (isset($view_tutorials_page)) {
            if($glob['cur_sub_name'] == 'All') {
                [B]$glob['title'] = [COLOR="Red"]'.[/COLOR]$glob['cur_cat_name'].' Tutorials';[/B]
    
    Code (markup):
     
    Social.Network, Jun 14, 2009 IP
  5. wvcaudill2

    wvcaudill2 Peon

    Messages:
    176
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #25
    Okay, I corrected everything you said, but now im getting this error:

     
    wvcaudill2, Jun 14, 2009 IP
  6. Social.Network

    Social.Network Member

    Messages:
    517
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    35
    #26
    Please repost the complete and updated snippet, thanks.
     
    Social.Network, Jun 14, 2009 IP
  7. wvcaudill2

    wvcaudill2 Peon

    Messages:
    176
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #27
    Sure.

    	// title of the page
    	$glob['rss'] = '';
    	
    	if(isset($index_page)) {
    		$glob['title'] = 'Photoshop tutorials, Flash tutorials, and more! Newtuts Tutorial Search';
    		$glob['rss'] = '<link rel="alternate" type="application/rss+xml" title="'.COMPANY_NAME.' - Latest Tutorials" href="'.HTTP_SERVER.'rss.php?do=latest" />';
    	}elseif (isset($contact_page)) {
    		$glob['title'] = COMPANY_NAME.' - Contact Us';
    	}elseif (isset($help_page)) {
    		$glob['title'] = COMPANY_NAME.' - Help';
    	}elseif (isset($read_tutorial_page)) {
    		$glob['title'] = $read_tutorial['title'];
    	}elseif (isset($submit2_page)) {
    		$glob['title'] = COMPANY_NAME.' - Submit Tutorials';
    	}elseif (isset($sourcesite_page)) {
    		$glob['title'] = 'Tutorials from '.$glob['sourcesite'];
    		$glob['rss'] = '<link rel="alternate" type="application/rss+xml" title="'.COMPANY_NAME.' - Tutorials from " href="'.HTTP_SERVER.'rss.php?do=sourcesite&source='.$glob['sourcesite'].'" />';
    	}elseif (isset($submit_page)) {
    		$glob['title'] = COMPANY_NAME.' - Submit Tutorials';
    	}elseif (isset($tutorials_page)) {
    		$glob['title'] = COMPANY_NAME.' - Browse Tutorials';
    		$glob['rss'] = '<link rel="alternate" type="application/rss+xml" title="'.COMPANY_NAME.' - Latest Tutorials" href="'.HTTP_SERVER.'rss.php?do=latest" />';
    	}elseif (isset($view_tutorials_page)) {
    		if($glob['cur_sub_name'] == 'All') {
    			$glob['title'] = $glob['cur_cat_name'].' Tutorials';
    			$glob['rss'] = '<link rel="alternate" type="application/rss+xml" title="'.$glob['cur_cat_name'].'' Tutorials'" href="'.HTTP_SERVER.'rss.php?do=cat&cat='.$glob['cur_cat_name'].'" />';
    		}else{
    			$glob['title'] = $glob['cur_sub_name'];
    			$glob['rss'] = '<link rel="alternate" type="application/rss+xml" title="'.$glob['cur_sub_name'].'' Tutorials'" href="'.HTTP_SERVER.'rss.php?do=subcat&cat='.$glob['cur_cat_name'].'&subcat='.$glob['cur_sub_name'].'" />';
    		}
    	}elseif (isset($users_page)) {
    		$glob['title'] = COMPANY_NAME.' - '.$user['username'].'\'s Profile Page';
    	}elseif (isset($register_page)) {
    		$glob['title'] = COMPANY_NAME.' - Register';
    	}elseif (isset($tutorial_out_page)) {
    		$glob['title'] = $glob['tutorial_out_title'];
    	}else{
    		$glob['title'] = 'Photoshop tutorials, Flash tutorials, and more! Newtuts Tutorial Search';
    	}
    PHP:
     
    wvcaudill2, Jun 14, 2009 IP
  8. redhits

    redhits Notable Member

    Messages:
    3,023
    Likes Received:
    277
    Best Answers:
    0
    Trophy Points:
    255
    #28
    What;s on line 803? lol
     
    redhits, Jun 14, 2009 IP
  9. wvcaudill2

    wvcaudill2 Peon

    Messages:
    176
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #29
    This:

    	}	
    	
    PHP:
     
    wvcaudill2, Jun 14, 2009 IP
  10. Social.Network

    Social.Network Member

    Messages:
    517
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    35
    #30
    Delete the code in RED below:

    $glob['rss'] = '<link rel="alternate" type="application/rss+xml" title="'.$glob['cur_cat_name'].'' Tutorials'"
    href="'.HTTP_SERVER.'rss.php?do=cat&cat='.$glob['cur_cat_name'].'" />';

    $glob['rss'] = '<link rel="alternate" type="application/rss+xml" title="'.$glob['cur_sub_name'].'' Tutorials'"
    href="'.HTTP_SERVER.'rss.php?do=subcat&cat='.$glob['cur_cat_name'].'&subcat='.$glob['cur_sub_name'].'" />';
     
    Social.Network, Jun 14, 2009 IP
  11. wvcaudill2

    wvcaudill2 Peon

    Messages:
    176
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #31
    Thanks! It works perfectly!
     
    wvcaudill2, Jun 14, 2009 IP
  12. Social.Network

    Social.Network Member

    Messages:
    517
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    35
    #32
    No problem, glad I could help out.
     
    Social.Network, Jun 14, 2009 IP
  13. wvcaudill2

    wvcaudill2 Peon

    Messages:
    176
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #33
    Hey, I was wondering if you could also figure out why my RSS icon and link arent working. For instance, if you go to a category, and click on the little RSS icon, it says the category doesnt exist. You can see this here: http://www.newtuts.com/view_tutorials.php?categorey=2D_Graphics&scategorey=Adobe_Flash

    Here is the code im using:
    <a href="$config[HTTP_SERVER]rss.php?do=subcat&cat=$glob[cur_cat_link]&subcat=$glob[cur_sub_link]"><img src="$config[HTTP_SERVER]images/2.0/rss.png" border="0px"></a>
    PHP:
    Any ideas why it isnt working?
     
    wvcaudill2, Jun 14, 2009 IP