Web Hosting Forum | Lunarpages


*
Welcome, Guest. Please login or register.
Did you miss your activation email?



Login with username, password and session length
February 09, 2012, 05:23:47 PM

Pages: [1] 2   Go Down
  Print  
Author Topic: How to edit page titles  (Read 2153 times)
Tsuchiyama
Intergalactic Cowboy
*****
Offline Offline

Posts: 60


WWW
« on: July 10, 2010, 12:10:02 AM »

I want to edit some of the page titles on
http://www.ts-export.com/

I've been able to do it OK for
http://www.ts-export.com/contact.php by directly editing the contact.php file with FileZilla.

However, when I try it for the other pages while the .php files will edit and save OK the changes won't display on the page.

These pages have a custom CMS to edit page content, but the page titles are not editable through the CMS. 

What files should I look for so I can edit these page titles?
Logged

durangod
Galactic Royalty
*****
Offline Offline

Posts: 203


« Reply #1 on: July 10, 2010, 10:43:01 AM »

can you be alittle more specific, are you trying to modify the text on the ie tab or are you trying to modify the content of the page itself...

by the way just fyi your getting a server error on your auction page...
Logged
Tsuchiyama
Intergalactic Cowboy
*****
Offline Offline

Posts: 60


WWW
« Reply #2 on: July 10, 2010, 08:06:07 PM »

Thanks Durangod.  I want to edit the page title displaying in the browser tab.

e.g. for the Homepage http://www.ts-export.com/
Current title is:
<title>Automative Exporters from Japan | TS-Export</title>
The title I want is:
<title>Exporters from Japan | TS EXPORT</title>   etc.

Good spotting on the auction section.  Yes, the auction is currently down for a script update.
Logged

durangod
Galactic Royalty
*****
Offline Offline

Posts: 203


« Reply #3 on: July 10, 2010, 08:59:37 PM »

well without being able to look at the actuall php files all i can offer at the time is to check the db and the config file, also check the language file, there may also be a language table inside the db,  not sure  i didnt see anything obvious in the source code view as i scanned it quickly...  and all im seeing is the rendered code anyway not the actual code.

i cant imagine why they would make them non editible in the db, you should be able to change them i have changed mine.    

let me ask you is the title tag i string value like this
Code:
<title> {value} </title>
or just as  you typed it

Code:
<title>Automative Exporters from Japan | TS-Export</title>


not sure why it wont change if you just change the title display...

i will keep thinking on this

update here is a thought, are you sure if you change the title tag it does not change its just your seeing the cached page.  i have been stumped by this myself trying to solve an error only to find out it was the old cache page that was loading not my changed page...  change the title tag, clear your cache and your cookies just in case and try to load it again, if you have both ie and ffox try loading it on the other browser after the change... 

« Last Edit: July 10, 2010, 09:07:48 PM by durangod » Logged
Tsuchiyama
Intergalactic Cowboy
*****
Offline Offline

Posts: 60


WWW
« Reply #4 on: July 10, 2010, 09:26:59 PM »

Thanks again Durangod.

I've now cleared cache and cookies using CCleaner but haven't seen any changes.  

But I've been able to successfully edit the page titles on the

HOME
http://www.ts-export.com/

CONTACT
http://www.ts-export.com/contact.php

and FAQ pages.
http://www.ts-export.com/faq.php

The pages that I'm having problems with are the ABOUT pages, i.e.

ABOUT US
http://www.ts-export.com/page.php?page=about

EXPORT CENTRE
http://www.ts-export.com/page.php?page=about_export_centre

VEHICLES
http://www.ts-export.com/page.php?page=about_vehicles

PARTS
http://www.ts-export.com/page.php?page=about_parts

OTHER STOCK
http://www.ts-export.com/page.php?page=about_others

FEES & CHARGES
http://www.ts-export.com/page.php?page=about_fees


I've been able to get the second part of the titles on these pages to display properly by modifying the page.php file, i.e. From TS-Export to TS EXPORT

<title><?php echo ucwords(str_replace("_", " ", $_GET['page'])); ?> | TS EXPORT</title>

What I'm having difficulty with is the first part of the title.  I modify the .php file for that page but the changes don't display.  

Is there a clue in finding what to modify in the first part of the titles ?

<?php echo ucwords(str_replace("_", " ", $_GET['page'])); ?>  ??

Where should I look for the db and config files?  Is there any code that I can paste in this ticket to help isolate the problem?

Again, many thanks for your help.

PS  I'm now getting an error on the ABOUT page
http://www.ts-export.com/about.php

Warning: Cannot modify header information - headers already sent by (output started at /home/tsuchi/public_html/about.php:1) in /home/tsuchi/public_html/about.php on line 3

The error comes when selecting ABOUT from the blue navigation bar when on one of the ABOUT series pages, e.g.
http://www.ts-export.com/page.php?page=about
http://www.ts-export.com/page.php?page=about_export_centre
http://www.ts-export.com/page.php?page=about_vehicles
http://www.ts-export.com/page.php?page=about_parts
http://www.ts-export.com/page.php?page=about_others
http://www.ts-export.com/page.php?page=about_fees


« Last Edit: July 10, 2010, 10:20:16 PM by Tsuchiyama » Logged

durangod
Galactic Royalty
*****
Offline Offline

Posts: 203


« Reply #5 on: July 11, 2010, 04:26:32 AM »

was this done thru a sitebuilder of some kind, i never understood why someone would even want the page display to be a var for me there no reason for it, its overkill and its just a pain in the butt...


take out the private info in the header php and the about.php replace the private stuff with xxx, and post it here, ill take a look...

if you cant do that its fine...  

you basically have two choices,

first no matter what make a backup copy of any file you change that way you can go back and start over if you need to.  just add old to the name that way you know..

 find out the source of  "page"  meaning someplace in your header php either it calls  your language or your config file or  function (php or js)    there is a setting for page, meaning it creates the value for page and you can modify how that works...

or

you can just remove that line totally and put a standard title tag in there

just remove the

Code:
<title><?php echo ucwords(str_replace("_"" "$_GET['page'])); ?> | TS EXPORT</title>

and put a normal

  
Code:
<title> whatever your title is </title>


the page us usually either set in a header by literal code right in the header or in your case prob by calling a function or using an include  to set it...

basically you can try to modify how it works or you can break the link and do your own....  

this is really hard to do without seeing your code..  

« Last Edit: July 11, 2010, 04:33:20 AM by durangod » Logged
Tsuchiyama
Intergalactic Cowboy
*****
Offline Offline

Posts: 60


WWW
« Reply #6 on: July 13, 2010, 07:57:38 AM »

Thanks again Durangod.  The site was built in Dreamweaver by a web developer. I'll never have another custom site again.   The next generation of sites will be on Wordpress.   I couldn't locate the header.php file.  Any ideas on where I should look?   There are different pages for each of the ABOUT series pages but this is the about.php top area code:   http://www.ts-export.com/page.php?page=about

<?php

header("Location: page.php?page=about");
exit;

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Exporters from Japan | TS EXPORT</title>
<style type="text/css">
<!--
body {
   background-image: url(img/template/right_bg.jpg);
   background-repeat: repeat-x;
   background-color: #7C8AA3;
   margin-left: 0px;
   margin-top: 0px;
   margin-right: 0px;
   margin-bottom: 0px;
   background-position: 0px 162px;
}
-->
</style>
<link href="ts-export.css" rel="stylesheet" type="text/css" />
</head>

<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0" style="background-image: url(img/template/ts-main_bg.gif);background-repeat: repeat-x;background-color: #333333;">
  <tr>
    <td>
      <table width="800" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <?php include("common/header.php"); ?>
        </tr>
      </table>
  </td>
  </tr>
</table><table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="21" background="img/template/top_menu_bar.gif"><?php include("common/menu.php"); ?></td>
  </tr>
  <tr>
    <td><table width="800" border="0" align="center" cellpadding="0" cellspacing="0" >
      <tr>
        <td width="773"><table width="717" border="0" align="right" cellpadding="0" cellspacing="0" style="border-left:solid 1px #CCCCCC; border-right:solid 1px #CCCCCC">
      <?php include("common/submenu_about.php"); ?>
          <tr>
            <td><table width="100%" border="0" cellspacing="0" cellpadding="0" style="border-bottom:solid 1px #CCCCCC">
              <tr>
                <td height="42" bgcolor="#475B7E">&nbsp;</td>
                <td width="321" rowspan="2"><img src="img/inside/photo<?php if(isset($_GET['photo']))echo $_GET['photo']; else echo rand(1,7); ?>.jpg" alt="Photo" width="321" height="77" /></td>
              </tr>
              <tr>
                <td><img src="img/titles/about.png" alt="Yahoo! Auction Service" width="394" height="35" /></td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td height="100" valign="top" bgcolor="#122440" style="background-image:url(img/template/navy_bg_shadow.gif); background-repeat:repeat-x; padding:10px; color:#FFFFFF" >
         <!--       Main Content Starts here       -->


This is from page.php

<?php


require_once("Connections/data_connect.php");
mysql_select_db($database_data_connect, $data_connect);

$query_Info = "SELECT * FROM  pages WHERE page = '".$_GET['page']."' ORDER BY order_no, id";
$Info = mysql_query($query_Info, $data_connect) or die(mysql_error());
$row_Info = mysql_fetch_assoc($Info);



?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title><?php echo ucwords(str_replace("_", " ", $_GET['page'])); ?> | TS EXPORT</title>
<style type="text/css">

Found header.php

<td colspan="2"><img src="img/template/ts-logo.jpg" alt="TS EXPORT" width="206" height="100" /></td>
        </tr>
        <tr>
          <td width="773"><div align="right"><img src="img/template/top_logo.png" alt="Company Established 1983" width="717" height="42" /></div></td>
          <td width="27">&nbsp;</td>


Found that this error is only occurring when selecting the ABOUT page from the blue navigation bar:

http://www.ts-export.com/about.php
Warning: Cannot modify header information - headers already sent by (output started at /home/tsuchi/public_html/about.php:1) in /home/tsuchi/public_html/about.php on line 3

and not from the other links on the site:
http://www.ts-export.com/page.php?page=about




« Last Edit: July 13, 2010, 08:40:52 AM by Tsuchiyama » Logged

durangod
Galactic Royalty
*****
Offline Offline

Posts: 203


« Reply #7 on: July 17, 2010, 11:48:28 AM »

sorry i was away for a few days.     ok looks like it pulls the page name from the database via

Code:
$query_Info = "SELECT * FROM  pages WHERE page = '".$_GET['page']."' ORDER BY order_no, id";

there is a pages table inside your database that you should be able to modify if you know how...

also you need to check out your folder named common for the header.php...

Code:
<?php include("common/header.php"); ?>

it really looks as if the first one you can just modify by itself without the db or anything just change the title

if that dont work check out any file that uses any include in the index php... it wont be the first time i have tracked a value thru several levels only to find it is set in a file i never suspected,  some php programmers are nuts bouncing all over the place for no good reason and no internal documentation....  

remember dont get too frustrated youll find it... its like finding a short in a car electrical system with a zillion wires... youll find it....   i cant tell you how many times i could have slapped the php programmer that did some of the stuff i work on, they set values in very obleke and almost hidden files that you never expect, i suppose they had their reaons but its stupid... there are other ways..

one program i work on for a client, every time i have to do anything i have to jump between 6 dif files or more...
its nuts..

but yours is not that bad.....  looks to me that should be rather easy with phpadmin to change the value in the table...  i admit i have never worked with dreamweaver, i dont use site builders of any kind, i do it all by hand which to me is the best way...  so i dont know what dreamweaver does with the info and how it stores it and if it locks the db values from being changed or not, but i dont think thats the case...

first thing i would do is attack the database.. then i would attack the includes if i could not see an obvious source in the file,  but since your new to this an easy way would be to make a copy of the index php file or template file which ever actually loads, some have index.tmp files or template index files.   my point is i would make a copy of what loads and name the old one to old (dont delete it) and use the copy as the load... and then i would strip it down if i had to, to nothing, that way it lessons what you hve to track...  i would scope the file down to nothing and load that copy in  the browser, until you can remove everything you can possibly remove until that tab message goes away....   then you know where its comming from

there are easier ways but i think it would just confuse you more...


remember this, they come from somewhere, either an include file, directly in the index, or in the database, or the header php file...

it has to be there...     sorry i cant be of much help here.. i know how frustrating i can be... but its so hard unless i can get in there and fish for myself...

let me know...  

by the way if you think your going to get away from this by using wp your incorrect, your still allowing another builder to build yoursite,  its just a dif format......   you need to do this yourself if you want total control over format and fixes and to know whats what and where it comes from.. using wp site is not much dif that what you have when we speak of control of the admin and programming repairs... best bet is do it yourself... or have a php programmer that you can tell them what you want and have them do it...



« Last Edit: July 17, 2010, 11:57:16 AM by durangod » Logged
Tsuchiyama
Intergalactic Cowboy
*****
Offline Offline

Posts: 60


WWW
« Reply #8 on: July 29, 2010, 04:28:56 AM »

Thanks Durangod.  Really appreciate the help on this.  Sorry I'm slow in understanding it and working through it. 

Found the header.php file

I had previously tried to change the alt text from


<td colspan="2"><img src="img/template/ts-logo.jpg" alt="TS-Export" width="206" height="100" /></td>
        </tr>
        <tr>
          <td width="773"><div align="right"><img src="img/template/top_logo.png" alt="Since 1983" width="717" height="42" /></div></td>
          <td width="27">&nbsp;</td>

to


<td colspan="2"><img src="img/template/ts-logo.jpg" alt="TS EXPORT" width="206" height="100" /></td>
        </tr>
        <tr>
          <td width="773"><div align="right"><img src="img/template/top_logo.png" alt="Company Established 1983" width="717" height="42" /></div></td>
          <td width="27">&nbsp;</td>

tried the old version again, just to see if it was causing the navigation problem

Warning: Cannot modify header information - headers already sent by (output started at /home/tsuchi/public_html/about.php:1) in /home/tsuchi/public_html/about.php on line 3

but both the old and new versions cause the same error.


I'd like to attack the problem in 2 stages:

1. Firstly get the navigation to the ABOUT page working again, then

2. Be able to modify the page titles that I haven't yet been able to modify


There's a couple of instructions I need clarification on:

"it really looks as if the first one you can just modify by itself without the db or anything just change the title"  Sorry, wasn't sure what this refers to.


"there is a pages table inside your database that you should be able to modify if you know how..."

Where should I look for this?

Again, many thanks for your help and sorry I'm slow to catch on.
Logged

MrPhil
Berserker Poster
*****
Offline Offline

Posts: 5083



« Reply #9 on: July 30, 2010, 08:26:22 AM »

It's telling you that you messed up something editing about.php, so that it's starting output to the browser too early (at or about line 1). Check for a blank or other character before the opening <?php. Check that some idiot Microsloth editor didn't drop a "UTF-8 Byte Order Mark" () at the very beginning of the file (remove it). Let us know if one or the other didn't fix it. Check the page (View > Page source) and look to see what the very beginning of the output is -- a blank, BOM, error message, or hack output.
Logged

Tsuchiyama
Intergalactic Cowboy
*****
Offline Offline

Posts: 60


WWW
« Reply #10 on: July 30, 2010, 09:10:28 AM »

Thanks MrPhil.

This is the code at the top of about.php

<?php

header("Location: page.php?page=about");
exit;

?>

And this is the view source of the ABOUT page:

view-source:http://www.ts-export.com/page.php?page=about

Can you see anything that needs fixing?

Thanks again.




Logged

MrPhil
Berserker Poster
*****
Offline Offline

Posts: 5083



« Reply #11 on: July 30, 2010, 12:15:43 PM »

And this is the view source of the ABOUT page:

view-source:http://www.ts-export.com/page.php?page=about
That's not what I asked you to look at. If I give that URL (http://www.ts-export.com/page.php?page=about) it comes up fine (with title About | TS EXPORT). If I give http://www.ts-export.com/about.php, it gives the "headers already sent" error. "View source" means bringing up the page in question in the browser, clicking the View button, and clicking "Page source" (or "Page", or something similar) to show the HTML sent to the browser. In the case of directly viewing about.php, all that shows up is the "headers already sent" error message, so maybe that's what confused you.

Copy and paste into [code] tags the first 10 lines of the about.php file so we can look at it. Are we supposed to be able to run about.php by itself, or are we supposed to go through the page.php? Maybe there's something in the file about.php that's supposed to blow up if the file is run by itself?

By the way, why does the page say "Requires Internet Explorer"? It certainly seems to work well enough with Firefox. Does it have some IE-specific Javascript code or something? The days are long over when you could get away with telling visitors to use only one specific browser. You're going to lose customers if they can't use their favorite browser.
Logged

Tsuchiyama
Intergalactic Cowboy
*****
Offline Offline

Posts: 60


WWW
« Reply #12 on: July 30, 2010, 04:44:07 PM »

Thanks again MrPhil.
The ABOUT page loads fine from http://www.ts-export.com/page.php?page=about
But doesn't load from http://www.ts-export.com/about.php - which it used to - which is the ABOUT link on the blue navigation bar.

More of the about.php code is here:

Code:
<?php

header
("Location: page.php?page=about");
exit;

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Exporters from Japan | TS EXPORT</title>
<style type="text/css">
<!--
body {
background-image: url(img/template/right_bg.jpg);
background-repeat: repeat-x;
background-color: #7C8AA3;
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
background-position: 0px 162px;
}
-->
</style>
<link href="ts-export.css" rel="stylesheet" type="text/css" />
</head>



Re "Requires Internet Explorer" - when the translate script was added a couple of years back there were errors on some non IE browsers when using translate.  I've done some cross-browser checks and it seems to work OK with all browsers now so will have the "Requires Internet Explorer" taken down.  Thanks for the pointer on this.


Logged

MrPhil
Berserker Poster
*****
Offline Offline

Posts: 5083



« Reply #13 on: July 30, 2010, 10:25:05 PM »

Got it! I ran about.php and got the "Headers already sent". View > Character Encoding told me that the page was in UTF-8 (as is the home page, which runs OK). Changed the encoding from UTF-8 to Latin-1, and up popped a Byte Order Mark (). Edit your file to get rid of it (and confirm that it's gone), and you should be fine. Note that the BOM may be invisible in your editor, if your PC (or host control panel) is in UTF-8, so it may take some doing (such as switching to Latin-1 or Windows-1252) to make this critter visible.

Does page.php?page=about end up calling about.php, or is it separate code? If the latter, is about.php just a dummy page which redirects to the real "about"?

Anyway, it's 0125 hours and I think I'll celebrate by going to bed.
Logged

Tsuchiyama
Intergalactic Cowboy
*****
Offline Offline

Posts: 60


WWW
« Reply #14 on: July 31, 2010, 07:09:26 PM »

Thanks again MrPhil.  Sorry this is such a pesky issue... again makes me appreciate WordPress.

Starting with your question

Quote
Does page.php?page=about end up calling about.php, or is it separate code? If the latter, is about.php just a dummy page which redirects to the real "about"?

The text in the body of about.php was the original text put in by the developer.  I've since modified this through the CMS and so the served page has different text and graphics in the body to that in in about.php.   I'm not sure how to locate the files in the database that the CMS writes to, but will probably need to do this to modify the page titles that I haven't been able to modify through the .php files for that page.

Now to the Byte Order Mark critter.

Could removing it mess up with the CMS?   I'm wondering if it is a bug, or did the developer put it in there for a reason.

I tried to edit the critter out of about.php by:

Creating an original backup copy of about.php on my desktop in a separate folder with FileZilla.
Creating another copy of about.php on my desktop that I could edit.
Loaded the copy of about.php for editing into NoteTab Light.
Couldn't find an Encoding option, so went to View in Browser and was able to view the critter in Windows-1252
Couldn't see how to do the edit in the browser, so enabled Firebug.
Was able to do the edit, but couldn't save the edited version of the file.  Got the error Failed-local file.

Is there another way to do it?  Sorry, this is new territory for me.
« Last Edit: August 02, 2010, 06:14:20 PM by Tsuchiyama » Logged

Pages: [1] 2   Go Up
  Print  
 
Jump to: