This topic is locked
[SOLVED]

 Meta and title tags

12/30/2011 12:23:31 PM
PHPRunner General questions
author

Hi everyone! I know that this has been discussed in the past but . .
I want to be able to create a title tag that uses the value from "RegName". I have the following code in the 'before display' event now.


$sql = "SELECT RegName, SireID, DamID, Title, Title2, Title3, Title4, Title5, Title6, Title7, Title8, Title9, Addl_Titles, Photo FROM pedigrees WHERE ID=";
$thisDogQ = $sql . $values["ID"];

$thisDogR = db_query($thisDogQ,$conn);
$thisDogRow_value = mysql_fetch_assoc($thisDogR);

$thisDogRow_value = array (

'RegName' => $thisDogRow_value['RegName'],

'SireID' => $thisDogRow_value['SireID'],

'DamID' => $thisDogRow_value['DamID'],

'Title' => $thisDogRow_value['Title'],

'Title2' => $thisDogRow_value['Title2'],

'Title3' => $thisDogRow_value['Title3'],

'Title4' => $thisDogRow_value['Title4'],

'Title5' => $thisDogRow_value['Title5'],

'Title6' => $thisDogRow_value['Title6'],

'Title7' => $thisDogRow_value['Title7'],

'Title8' => $thisDogRow_value['Title8'],

'Title9' => $thisDogRow_value['Title9'],



'Addl_Titles' => $thisDogRow_value['Addl_Titles']);


Thanks!

C
cgphp 12/30/2011
$thisDogQ = "SELECT RegName, SireID, DamID, Title, Title2, Title3, Title4, Title5, Title6, Title7, Title8, Title9, Addl_Titles, Photo FROM pedigrees WHERE ID=".$values["ID"]." LIMIT 1";
$thisDogR = db_query($thisDogQ,$conn);
$thisDogRow_value = mysql_fetch_assoc($thisDogR);
$xt->assign("your_var_name",$thisDogRow_value['RegName']);
501400 12/31/2011


$thisDogQ = "SELECT RegName, SireID, DamID, Title, Title2, Title3, Title4, Title5, Title6, Title7, Title8, Title9, Addl_Titles, Photo FROM pedigrees WHERE ID=".$values["ID"]." LIMIT 1";
$thisDogR = db_query($thisDogQ,$conn);
$thisDogRow_value = mysql_fetch_assoc($thisDogR);
$xt->assign("your_var_name",$thisDogRow_value['RegName']);



Thanks so much, Christian, but that did not work. I have 3 projects and I've gone through all of them looking to see where the page title variable is being set but I cannot find it. All of the pages for all 3 projects have the same title page, which is the same as the name of the table is is based on or perhaps the name of the phprunner project. In all three of my cases they are the same.
Do you know how to override this? Do you think that because my events run before the view page that when the view page loads, it is overwriting the code you so kindly provided?

H
horsey_kim 1/1/2012



Thanks so much, Christian, but that did not work. I have 3 projects and I've gone through all of them looking to see where the page title variable is being set but I cannot find it. All of the pages for all 3 projects have the same title page, which is the same as the name of the table is is based on or perhaps the name of the phprunner project. In all three of my cases they are the same.
Do you know how to override this? Do you think that because my events run before the view page that when the view page loads, it is overwriting the code you so kindly provided?


Which version are you using 5.3 or 6.0? I have have a tag database that I use on pages. But have not done so on 6.0 yet. So let me know, maybe what i have can help you.
Kim

501401 1/1/2012



Which version are you using 5.3 or 6.0? I have have a tag database that I use on pages. But have not done so on 6.0 yet. So let me know, maybe what i have can help you.
Kim


Hi Kim: I'm using 6.0. But thanks anyway!

C
cgphp 1/1/2012
  1. Close PHPrunner.
  2. Go to the following path:

C:\Program Files\PHPRunner5.3\templates\layouts\<theme>



<theme> is the theme (London, Amsterdam etc.) you are actually using for your project.
3. Edit the lheader.htm file and replace the follwoing line:

<title>##@TABLE.strCaption h##</title>



with

<title>{$custom_title}</title>


4. Save the file.
5. Open your project in PHPrunner
6. In the "Before display" event assign the custom title to the {$custom_title} var:

$xt->assign("custom_title","This is a custom title");
501402 1/1/2012

Perhaps the problem is that I am using 6.0??? Would this new script work in 6.0?


  1. Close PHPrunner.
  2. Go to the following path:

C:\Program Files\PHPRunner5.3\templates\layouts\<theme>



<theme> is the theme (London, Amsterdam etc.) you are actually using for your project.
3. Edit the lheader.htm file and replace the follwoing line:

<title>##@TABLE.strCaption h##</title>



with

<title>{$custom_title}</title>


4. Save the file.
5. Open your project in PHPrunner
6. In the "Before display" event assign the custom title to the {$custom_title} var:

$xt->assign("custom_title","This is a custom title");


501403 1/1/2012

I went to my templates folder, opened 'pedigrees_view.htm', replaced <title>$pagetitle</title> with <title>$custom_title</title>. Then in my events, I put this:



$custom_title="";

$xt->assign("custom_title",$thisDogRow_value['RegName']);


and DRUM ROLL PLEASE
It WORKED!!!!!
Thank you so much!!!!


  1. Close PHPrunner.
  2. Go to the following path:

C:\Program Files\PHPRunner5.3\templates\layouts\<theme>



<theme> is the theme (London, Amsterdam etc.) you are actually using for your project.
3. Edit the lheader.htm file and replace the follwoing line:

<title>##@TABLE.strCaption h##</title>



with

<title>{$custom_title}</title>


4. Save the file.
5. Open your project in PHPrunner
6. In the "Before display" event assign the custom title to the {$custom_title} var:

$xt->assign("custom_title","This is a custom title");