<? DEW-CODE.COM  

Downloads

Assorted scripts  (1)
DewNewPHPLinks  (9)





Lost Password?
No account yet? Register

Dew-Code Newsfeed

Resources


 USdigitalcable.com

Dew-Code
Welcome, Guest
Please Login or Register.    Lost Password?
Re:What's New Page Title (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: Re:What's New Page Title
#808
fattymattybrewing (User)
Support Your Local Brewer
Expert Boarder
Posts: 117
graphgraph
User Offline Click here to see the profile of this user
Gender: Male Fatty Matty Brewing Location: Southwestern Wisconsin Birthdate: 1974-11-05
What's New Page Title 3 Years, 3 Months ago Karma: 3  
Here is a customization which I though should be easy but I can't seem to figure it out... too many late nights or something I guess.

I am going to the What's New page on my site's links directory at http://www.fattymattybrewing.com/directory/new.html and would like to add a page title in the html header for the What's New page. Where do I find the new.php file that creates this SEF to be file?

Thanks
 
Report to moderator   Logged Logged  
 
Lifes Too Short To Drink Crappy Beers
fattymattybrewing.com
  The administrator has disabled public write access.
#809
Dewed (Admin)
Admin
Posts: 605
graph
User Online Now Click here to see the profile of this user
Dew-Code.com
Re:What's New Page Title 3 Years, 3 Months ago Karma: 9  
You mean the <title> tag ?

If I recall correctly you use the dynamic title function so you get category names in your titles, so the following code will look a little different, but I think you'll get the idea...


Near the top of the directory file you should see something like this..

Code:

if ($url_array[1] == "new.html"){$show="new";} if ($url_array[1] == "popular.html"){$show="pop";} if ($url_array[1] == "cool.html"){$show="cool";} if ($url_array[1] == "add.html"){$show="add";} if ($url_array[1] == "about.html"){$show="about";} if ($url_array[1] == "review.html"){$show="review";} if ($url_array[1] == "update.html"){$show="update";} if ($url_array[1] == "owner.html"){$show="owner";} if ($url_array[1] == "review_add.html"){$show="review_add";}
You can tweak this a bit so you'll have unique titles for these pages as well..
Code:

if ($url_array[1] == "new.html"){$show="new"; $addtitle=' The latest and greatest';}
note the preceding space in the custom page title above. You could do something similar for each of the page types, just assign a different string to the $addtitle variable Then further down where you find the <title> tag, just add echo $addtitle;
 
Report to moderator   Logged Logged  
 
Last Edit: 2009/01/28 15:11 By Dewed.
 
Nothing to it but to Dew it !
Dew-Code.com
  The administrator has disabled public write access.
#810
fattymattybrewing (User)
Support Your Local Brewer
Expert Boarder
Posts: 117
graphgraph
User Offline Click here to see the profile of this user
Gender: Male Fatty Matty Brewing Location: Southwestern Wisconsin Birthdate: 1974-11-05
Re:What's New Page Title 3 Years, 3 Months ago Karma: 3  
very cool, I will try this out and let you know how it flies.
 
Report to moderator   Logged Logged  
 
Lifes Too Short To Drink Crappy Beers
fattymattybrewing.com
  The administrator has disabled public write access.
#811
fattymattybrewing (User)
Support Your Local Brewer
Expert Boarder
Posts: 117
graphgraph
User Offline Click here to see the profile of this user
Gender: Male Fatty Matty Brewing Location: Southwestern Wisconsin Birthdate: 1974-11-05
Re:What's New Page Title 3 Years, 3 Months ago Karma: 3  
ok, I understand how to add this:
Code:

if ($url_array[1] == "new.html"){$show="new"; $addtitle=' The latest and greatest';}
but when it comes to:
QUOTE:
just assign a different string to the $addtitle variable Then further down where you find the <title> tag, just add echo $addtitle;
it get a lot confusing... I have attached my directory file so you can see exactly what I am dealing with... my <title> tag is a bit tricky because it has some code in there to make the page title dynamic depending on the link category that the user is browsing. Any ideas on how I should write the code for the "What's New" page's <title> tag?
File Attachment:
File Name: directory.zip
File Size: 3519
 
Report to moderator   Logged Logged  
 
Last Edit: 2009/01/29 10:13 By fattymattybrewing.
 
Lifes Too Short To Drink Crappy Beers
fattymattybrewing.com
  The administrator has disabled public write access.
#813
Dewed (Admin)
Admin
Posts: 605
graph
User Online Now Click here to see the profile of this user
Dew-Code.com
Re:What's New Page Title 3 Years, 3 Months ago Karma: 9  
Hrm. ok part of teh problem is this line

if(!isset($term) and !isset($show)){

so if "$show" is set, which it is on the new.html page, then none of your title and meta tag code is ran.

Getting rid of the !isset($show) part, you wind up with this ...

Code:

<?php if(!isset($term)){ if(!isset($PID)){ ?> <title>Fatty Matty Brewing<?php echo $addtitle;?></title>
And how you've defined $addtitle is fine, just be sure to esccape any apostrophes ..
Code:

if ($url_array[1] == "new.html"){$show="new"; $addtitle=' Newest Beer & Homebrewing Links added to Fatty Matty Brewing';} if ($url_array[1] == "astore.html"){$show="astore"; $addtitle = 'gettin\' the good stuff';} if ($url_array[1] == "recipes.html"){$show="recipes"; $addtitle='Here\'s another apostophe';}
 
Report to moderator   Logged Logged  
 
Nothing to it but to Dew it !
Dew-Code.com
  The administrator has disabled public write access.
#816
fattymattybrewing (User)
Support Your Local Brewer
Expert Boarder
Posts: 117
graphgraph
User Offline Click here to see the profile of this user
Gender: Male Fatty Matty Brewing Location: Southwestern Wisconsin Birthdate: 1974-11-05
Re:What's New Page Title 3 Years, 3 Months ago Karma: 3  
Wow that worked so well, now my site is fully SEF! not only do I have dynamic page titles on the categories but also dynamic page titles for the "NEW" "TOP" "ABOUT" and other pages that did not have page titles before. look out Google PR here I come!

Thanks so much and anyone else interested in this customization please chime in and ask questions...
 
Report to moderator   Logged Logged  
 
Lifes Too Short To Drink Crappy Beers
fattymattybrewing.com
  The administrator has disabled public write access.
Go to top Post Reply
get the latest posts directly to your desktop
Outsource your projects to thousands of programmers at
ScriptLance.com
Newsflash
Interested in
advertising?

This space for rent!

Sign up for PayPal and start accepting credit card payments instantly.
Copyright Dew-Code 2008