Author |
Message |
micah
Hangin' Around

Joined: May 25, 2006
Posts: 40
|
Posted:
Sat Apr 17, 2010 8:52 am |
|
Hi,
I am trying to change the page title of the content module. What I would like to display instead of the module name "Content" is the title of the content page that I enter in for the content title.
I use phpnuke 8.0
I thought that I could change
$pagetitle = "- $module_name";
to
$pagetitle = "- $mytitle";
but that does now work. I know that I am missing something but any support would be wonderful.
Below is a patch of code from my content module
-----
function showpage($pid, $page=0) {
global $prefix, $db, $sitename, $admin, $module_name;
include("header.php");
OpenTable();
$pid = intval($pid);
$mypage = $db->sql_fetchrow($db->sql_query("SELECT * FROM ".$prefix."_pages WHERE pid='$pid'"));
$myactive = intval($mypage['active']);
$mytitle = stripslashes(check_html($mypage['title'], "nohtml"));
$mysubtitle = stripslashes(check_html($mypage['subtitle'], "nohtml"));
$mypage_header = stripslashes($mypage['page_header']);
$mytext = stripslashes($mypage['text']);
$mypage_footer = stripslashes($mypage['page_footer']);
$mysignature = stripslashes($mypage['signature']);
$mydate = $mypage['date'];
$mycounter = intval($mypage['counter']);
-------
Thank you very much,
Micah |
|
|
|
 |
wHiTeHaT
Life Cycles Becoming CPU Cycles

Joined: Jul 18, 2004
Posts: 579
|
Posted:
Sat Apr 17, 2010 9:01 am |
|
put in your header.php , search for $pagetitle below add:
global $mytitle;
if ($name =='Content' && isset($mytitle)){
$pagetitle = '-'.$mytitle;
}else{
$pagetitle = 'Content';
} |
|
|
|
 |
micah

|
Posted:
Sat Apr 17, 2010 9:19 am |
|
Hi and thank you very much but
below is my header.php file. Which $pagetitle do I place that code after?
function head() {
global $slogan, $sitename, $banners, $nukeurl, $Version_Num, $artpage, $topic, $hlpfile, $user, $hr, $theme, $cookie, $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4, $textcolor1, $textcolor2, $forumpage, $adminpage, $userpage, $pagetitle;
$ThemeSel = get_theme();
include_once("themes/$ThemeSel/theme.php");
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n";
echo "<html>\n";
echo "<head>\n";
echo "<title>$sitename $pagetitle</title>\n";
include("includes/meta.php");
include("includes/javascript.php");
if (file_exists("themes/$ThemeSel/images/favicon.ico")) {
echo "<link REL=\"shortcut icon\" HREF=\"themes/$ThemeSel/images/favicon.ico\" TYPE=\"image/x-icon\">\n";
}
echo "<link rel=\"alternate\" type=\"application/rss+xml\" title=\"RSS\" href=\"backend.php\">\n";
echo "<LINK REL=\"StyleSheet\" HREF=\"themes/$ThemeSel/style/style.css\" TYPE=\"text/css\">\n\n\n";
if (file_exists("includes/custom_files/custom_head.php")) {
include_once("includes/custom_files/custom_head.php");
}
echo "\n\n\n</head>\n\n";
if (file_exists("includes/custom_files/custom_header.php")) {
include_once("includes/custom_files/custom_header.php");
}
themeheader();
}
thanks ,
Micah |
|
|
|
 |
wHiTeHaT

|
Posted:
Sat Apr 17, 2010 10:39 am |
|
between:
Code:
echo "<head>\n";
//HERE//
echo "<title>$sitename $pagetitle</title>\n";
|
|
|
|
|
 |
wHiTeHaT

|
Posted:
Sat Apr 17, 2010 10:42 am |
|
Replace your function with this 1
Code:
function head() {
global $slogan, $sitename, $banners, $nukeurl, $Version_Num, $artpage, $topic, $hlpfile, $user, $hr, $theme, $cookie, $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4, $textcolor1, $textcolor2, $forumpage, $adminpage, $userpage, $pagetitle,$mytitle,$name;
$ThemeSel = get_theme();
include_once("themes/$ThemeSel/theme.php");
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n";
echo "<html>\n";
echo "<head>\n";
if ($name =='Content' && isset($mytitle)){
$pagetitle = '-'.$mytitle;
}else{
$pagetitle = 'Content';
}
echo "<title>$sitename $pagetitle</title>\n";
include("includes/meta.php");
include("includes/javascript.php");
if (file_exists("themes/$ThemeSel/images/favicon.ico")) {
echo "<link REL=\"shortcut icon\" HREF=\"themes/$ThemeSel/images/favicon.ico\" TYPE=\"image/x-icon\">\n";
}
echo "<link rel=\"alternate\" type=\"application/rss+xml\" title=\"RSS\" href=\"backend.php\">\n";
echo "<LINK REL=\"StyleSheet\" HREF=\"themes/$ThemeSel/style/style.css\" TYPE=\"text/css\">\n\n\n";
if (file_exists("includes/custom_files/custom_head.php")) {
include_once("includes/custom_files/custom_head.php");
}
echo "\n\n\n</head>\n\n";
if (file_exists("includes/custom_files/custom_header.php")) {
include_once("includes/custom_files/custom_header.php");
}
themeheader();
}
|
|
|
|
|
 |
micah

|
Posted:
Sat Apr 17, 2010 11:25 am |
|
Hi Again,
I am so sorry ... but that does not still seem to work for me
This is my header.php
function head() {
global $slogan, $sitename, $banners, $nukeurl, $Version_Num, $artpage, $topic, $hlpfile, $user, $hr, $theme, $cookie, $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4, $textcolor1, $textcolor2, $forumpage, $adminpage, $userpage, $pagetitle, $mytitle, $name;
$ThemeSel = get_theme();
include_once("themes/$ThemeSel/theme.php");
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n";
echo "<html>\n";
echo "<head>\n";
global $mytitle;
if ($name =='Content' && isset($mytitle)){
$pagetitle = '-'.$mytitle;
}else{
$pagetitle = 'Content';
}
echo "<title>$sitename $pagetitle</title>\n";
Do I need to make any changes in the content index.php file ?
Again ... thanks .. sorry.
Micah |
|
|
|
 |
spasticdonkey
RavenNuke(tm) Development Team

Joined: Dec 02, 2006
Posts: 1693
Location: Texas, USA
|
Posted:
Sat Apr 17, 2010 12:59 pm |
|
what happens if you just try to echo $mytitle ?
echo "<title>$mytitle</title>\n";
I'm guessing it has not been defined at the time header.php is loaded.
Since you are not using RN, have you considered TegoNuke(tm) DynamicTitles instead?
http://montegoscripts.com/download-file-38.html |
|
|
|
 |
wHiTeHaT

|
Posted:
Sat Apr 17, 2010 1:54 pm |
|
you must quote out the $pagetitle = "- $module_name"; in your index.php of the content module.
like:
//$pagetitle = "- $module_name"; |
|
|
|
 |
micah

|
Posted:
Sat Apr 17, 2010 1:55 pm |
|
I just tried out TegoNuke(tm) DynamicTitles but it still only prints out mysite - Content
I am looking for it to print out - the title of each of my content pages.
-
Micah |
Last edited by micah on Sat Apr 17, 2010 3:43 pm; edited 1 time in total |
|
|
 |
micah

|
Posted:
Sat Apr 17, 2010 2:05 pm |
|
Whitehat - I just tried #$pagetitle = "- $module_name";
but this still does not do the trick.
It still prints out sitename Content
Micah |
|
|
|
 |
montego
Site Admin

Joined: Aug 29, 2004
Posts: 9457
Location: Arizona
|
Posted:
Sat Apr 17, 2010 5:24 pm |
|
micah wrote: | I just tried out TegoNuke(tm) DynamicTitles but it still only prints out mysite - Content
I am looking for it to print out - the title of each of my content pages.
-
Micah |
Micah,
Does your copy of Dynamic Titles have this code in it:
Code:
/*
* Content
*/
elseif ($name == 'Content') {
global $pa, $cid, $pid;
if ($pa == 'list_pages_categories') {
$sql = 'SELECT title, description FROM ' . $prefix . '_pages_categories WHERE cid=\'' . intval($cid) . '\'';
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$newpagetitle = $row['title'] . $dt_sDelim . $row['description'] . $dt_sDelim . $sitename;
} elseif ($pa == 'showpage') {
$sql = 'SELECT title, cid, subtitle FROM ' . $prefix . '_pages WHERE pid=\'' . intval($pid) . '\'';
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$asDTText['subject'] = $row['title'];
if ($row['subtitle'] != '') {
$asDTText['subject'] .= $dt_sDelim . $row['subtitle'];
}
$sql = 'SELECT title FROM ' . $prefix . '_pages_categories WHERE cid=\'' . intval($row['cid']) . '\'';
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
if ($row['title'] == '') {
$newpagetitle = $asDTText['subject'] . $dt_sDelim . $sitename;
} else {
$newpagetitle = $asDTText['subject'] . $dt_sDelim . $row['title'];
}
}
}
|
If so, then what Content module are you using? It must not be the standard PHP-Nuke 8.0 one? |
_________________ Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! |
|
|
 |
jestrella
Moderator

Joined: Dec 01, 2005
Posts: 593
Location: Santiago, Dominican Republic
|
Posted:
Sat Apr 17, 2010 11:03 pm |
|
|
|
 |
micah

|
Posted:
Sat Apr 17, 2010 11:21 pm |
|
thank you for all of your help. after many hours and all of your help I solved the problem.
Again thanks to all
Micah |
|
|
|
 |
montego

|
Posted:
Sun Apr 18, 2010 3:20 pm |
|
micah wrote: | I solved the problem. |
Can you give us an idea what the issue was in case others stubble upon this thread?
Thanks. |
|
|
|
 |
micah

|
Posted:
Sun Apr 18, 2010 3:28 pm |
|
One of the main problems was that the header.php file include is placed too high in the script. I lowered it to below the functions where it seemed to work. |
|
|
|
 |
jestrella

|
Posted:
Sun Apr 18, 2010 7:40 pm |
|
header.php should be one of the first scripts to be included, the first one at last... You could be breaking standards including this file lower in your script... Can you please provide a link to your site so we can have a look? |
|
|
|
 |
micah

|
Posted:
Sun Apr 18, 2010 7:52 pm |
|
I have now upgraded to content plus. This is what I should have done in the first place. Seems like a way better way to go. |
|
|
|
 |
jestrella

|
Posted:
Sun Apr 18, 2010 7:56 pm |
|
You've been warned!!!  |
|
|
|
 |
micah

|
Posted:
Sun Apr 18, 2010 8:03 pm |
|
I dont understand. What have I been warned about? Also what does it mean by breaking standards? did I do something wrong? |
|
|
|
 |
jestrella

|
Posted:
Sun Apr 18, 2010 8:10 pm |
|
|
|
 |
|