|
The comments are owned by the poster. We aren't responsible for their content.
| Poster | Thread |
|---|---|
| tl001 | Posted: 2005/6/18 10:58 Updated: 2005/6/18 11:01 |
Webmaster ![]() ![]() Joined: 2004/6/10 From: Posts: 282 |
Quote:
Tim: the contact form is not for answering questions about our TIPs. We would appreciate it if you could register with us and post your comments in the future. As of your question, this TIP should explain on how you can accomplish it. You first must decide what to be your pagetitle, then assign that to pagetitle smarty variable. Not sure about your story.title part, if you are using the latest news module, you should not worry about it, as it already has the pagetitle part covered. Please register and post your further questions. |
| tgrigg | Posted: 2005/6/19 16:28 Updated: 2005/8/21 20:22 |
Just popping in ![]() ![]() Joined: 2005/6/19 From: Posts: 1 |
Cheers for that now i have read and this is what i have done, I have added this code to news module article.php
Quote: $ptitle = $story['title']; but it's not worked to good it puts this in the page title Quote: <a href='http://192.168.2.4/modules/news/index.php?storytopic=1'> Could you help me fix it please |
| tl001 | Posted: 2005/6/19 16:51 Updated: 2005/6/19 16:51 |
Webmaster ![]() ![]() Joined: 2004/6/10 From: Posts: 282 |
Tim:
You need to use article->title $story['title'] is for the display of news' URLs. As I have mentioned earlier, you may want to upgrade your news to the most recent version, so you don't have to worry about display of your news titles. Or take a close look on how the pagetitle is being assigned by the recent versions. |
| macmend | Posted: 2005/8/21 19:57 Updated: 2005/8/21 20:02 |
Just popping in ![]() ![]() Joined: 2005/8/21 From: Posts: 17 |
I am struggling with weblog 1.41 module, as for the categories and weblog entries the correct code is not obvious, it appears to use some kind of varying string, but as I am only a part time coder I am not sure.
for example $category['cat_title'] = $cat->getVar('cat_title', 's'); there are no obvious relationships between category or article title and simple dollar encode words like $cat or $cat_id, these all seem to be arrays or display as the word array.....eek...help |
| tl001 | Posted: 2005/8/21 20:17 Updated: 2005/8/21 20:21 |
Webmaster ![]() ![]() Joined: 2004/6/10 From: Posts: 282 |
I don't use weblog, I have just downloaded it and taken a look.
The module has assigned a title which you can "borrow" as a pagetitle Quote:
try to add one line after it Quote:
If you want to add categories into pagatitle, use the following: Quote:
You may want to take a closer look of News module to see how it assigns pagetitle. |
| macmend | Posted: 2005/8/22 4:15 Updated: 2005/8/22 4:58 |
Just popping in ![]() ![]() Joined: 2005/8/21 From: Posts: 17 |
thanks for your reply, I have been trying to get hold of the weblog people, I think my problem is understanding their code.
In the example you gave me, an individual entry ends up with the blog name as a page title, a category ends up with the name of the last individual entry on that category page as the title, og and the category ID appears to just be a number its confusing not from the coding you are suggesting but working out how this module assigns category names and article titles (sometime later) ok I have altered both index.php and article.php and this gives a good result, however the category pages I still can't figure out. |
| macmend | Posted: 2005/8/22 8:41 Updated: 2005/8/22 8:41 |
Just popping in ![]() ![]() Joined: 2005/8/21 From: Posts: 17 |
after a struggle i found the part that puts the category name up and wonder if you could help...this is the part in index.php that defines the category but it displays as an html link
$path = $weblogcat->getNicePathFromId($entryObject->getVar('cat_id'), sprintf('%s/modules/%s/index.php?user_id=%d', XOOPS_URL, $xoopsModule->dirname(), $user_id)); $entry['category'] = $path; use of category like this: $xoopsTpl->assign('xoops_pagetitle', htmlentities($page_subtitle . ' -' . $xoopsModule->name() . ' -' . $entry['category'] )); brings up a whole great long URL as well as the category name, is there anyway of seperating it out |
| tl001 | Posted: 2005/8/22 8:55 Updated: 2005/8/22 10:13 |
Webmaster ![]() ![]() Joined: 2004/6/10 From: Posts: 282 |
You may want to try:
add this line after the pagetitle $logcat =$weblogcat->getCategory($entryObject->getVar('cat_id')); then $xoopsTpl->assign('xoops_pagetitle', htmlentities($page_subtitle . ' -' . $xoopsModule->name() . ' -' . $logcat )); [edit] Be sure to get rid of PHPSessionIDs pended to your URLs. [/edit] |
| zigzag | Posted: 2005/8/30 7:24 Updated: 2005/8/30 7:24 |
Just popping in ![]() ![]() Joined: 2005/7/31 From: Posts: 2 |
Hello,
I would like to add page titles to individual events in the AM Events module but I can't seem to get it to work (I'm not a coder ) I've been fiddling with it all day & the nearest I've got is for each event page to be called "['event_name']" with the brackets include ('header.php'); #include ('include/config.php'); #include_once ('include/functions.inc.php'); $myts =& MyTextSanitizer::getInstance(); //if (isset($_GET['cat_id'])) { $cat_id = $_POST['cat_id']; } ################################################## # if (!isset($_GET['id']) && !isset($_GET['v'])) { // this page uses smarty template // this must be set before including main header.php $xoopsOption['template_main'] = 'event_index.html'; include XOOPS_ROOT_PATH.'/header.php'; $xoopsTpl->assign('eventlist_caption', _MD_EVENTLIST_CAPTION); $xoopsTpl->assign('eventcol_caption', _MD_EVENTCOL_CAPTION); $xoopsTpl->assign('datestartcol_caption', _MD_DATESTARTCOL_CAPTION); $xoopsTpl->assign('dateendcol_caption', _MD_DATEENDCOL_CAPTION); $xoopsTpl->assign('datedurcol_caption', _MD_DATEDURCOL_CAPTION); $class = "even"; #$todaysdate = date("Y-m-d"); #$sql = ("SELECT * FROM " .$xoopsDB->prefix('amevents_events') . " WHERE event_date_start >= $todaysdate AND event_validated=1 AND event_showme=1 ORDER BY event_date_start ASC"); $sql = ("SELECT * FROM " .$xoopsDB->prefix('amevents_events') . " WHERE event_date_start >= NOW() AND event_validated=1 AND event_showme=1 ORDER BY event_date_start ASC"); $result=$xoopsDB->query($sql); while($myrow = $xoopsDB->fetchArray($result)) { $amevent = array(); $amevent['event_id'] = $myrow['id']; $amevent['event_name'] = $myts->displayTarea($myrow['event_name'], 0, 0, 1, 0, 0); $amevent['event_date_start'] = format_date($myrow['event_date_start'], $xoopsModuleConfig['datefrmt']); $amevent['event_date_end'] = format_date($myrow['event_date_end'], $xoopsModuleConfig['datefrmt']); $amevent['event_duration'] = $myrow['event_duration']; $amevent['event_country'] = $myrow['event_country']; if($class == "even") { $class = "odd"; } else { $class = "even"; } $amevent['event_class'] = $class; if (!file_exists(XOOPS_ROOT_PATH ."/modules/amevents/images/flags/". $amevent['event_country'].".gif")) { //echo XOOPS_ROOT_PATH . "/modules/amevents/images/flags/" . $amevent['event_country']. ".gif<br>"; $amevent['event_country'] = "00"; } $xoopsTpl->append_by_ref('amevents', $amevent); unset($amevent); } // end while #unset($category); } // end if ################################################# # if (isset($_GET['id'])) { $id = $_GET['id']; //echo $cat_id; $xoopsOption['template_main'] = 'event_item.html'; include XOOPS_ROOT_PATH.'/header.php'; $xoopsTpl->assign('index_link_text', _MD_INDEXLINKTEXT); $xoopsTpl->assign('print_art_link', _MD_INDEXLINKPRINT); $xoopsTpl->assign('email_friend', _MD_EMAIL); $xoopsTpl->assign('eventview_caption', _MD_EVENTVIEW_CAPTION); $xoopsTpl->assign('eventtitle_caption', _MD_EVENTTITLE_CAPTION); $xoopsTpl->assign('eventstart_caption', _MD_EVENTSTART_CAPTION); $xoopsTpl->assign('eventend_caption', _MD_EVENTEND_CAPTION); $xoopsTpl->assign('eventdur_caption', _MD_EVENTDUR_CAPTION); $xoopsTpl->assign('eventloc_caption', _MD_EVENTLOC_CAPTION); $xoopsTpl->assign('eventurl_caption', _MD_EVENTURL_CAPTION); $xoopsTpl->assign('eventdetails_caption', _MD_EVENTDETAILS_CAPTION); $sql = ("SELECT * FROM " .$xoopsDB->prefix('amevents_events') . " WHERE id='$id' AND event_validated=1 AND event_showme=1"); #$sql = ("SELECT * FROM " .$xoopsDB->prefix('amevents_events') . " ORDER BY event_date_start ASC"); $result=$xoopsDB->query($sql); while($myrow = $xoopsDB->fetchArray($result)) { $amevent = array(); $amevent['event_id'] = $myrow['id']; $amevent['event_name'] = $myts->displayTarea($myrow['event_name'], 0, 0, 1, 0, 0); $amevent['event_date_start'] = format_date($myrow['event_date_start'], $xoopsModuleConfig['datefrmtmain']); $amevent['event_date_end'] = format_date($myrow['event_date_end'], $xoopsModuleConfig['datefrmtmain']); $amevent['event_duration'] = $myrow['event_duration']; $amevent['event_description'] = $myts->displayTarea($myrow['event_description']); $amevent['event_url'] = $myrow['event_url']; $amevent['event_country'] = country($myrow['event_country']); $xoopsTpl->append_by_ref('amevents', $amevent); unset($amevent); } // end while } // end if ################################################# # if (isset($_GET['v'])) { if (isset($_GET['y'])) { $year = $_GET['y']; } if (isset($_GET['m'])) { $month = $_GET['m']; } if (isset($_GET['d'])) { $day = $_GET['d']; } $sqldate = $year . "-" . $month . "-" . $day; #echo $sqldate; // this page uses smarty template // this must be set before including main header.php $xoopsOption['template_main'] = 'event_indexday.html'; include XOOPS_ROOT_PATH.'/header.php'; $xoopsTpl->assign('index_link_text', _MD_INDEXLINKTEXT); $xoopsTpl->assign('eventlist_caption', _MD_EVENTLIST_CAPTION); $xoopsTpl->assign('eventcol_caption', _MD_EVENTCOL_CAPTION); $xoopsTpl->assign('datestartcol_caption', _MD_DATESTARTCOL_CAPTION); $xoopsTpl->assign('dateendcol_caption', _MD_DATEENDCOL_CAPTION); $xoopsTpl->assign('datedurcol_caption', _MD_DATEDURCOL_CAPTION); $class = "even"; #$todaysdate = date("Y-m-d"); #$sql = ("SELECT * FROM " .$xoopsDB->prefix('amevents_events') . " WHERE event_date_start >= $todaysdate AND event_validated=1 AND event_showme=1 ORDER BY event_date_start ASC"); $sql = ("SELECT * FROM " .$xoopsDB->prefix('amevents_events') . " WHERE event_date_start = '$sqldate' AND event_validated=1 AND event_showme=1 ORDER BY event_date_start ASC"); $result=$xoopsDB->query($sql); while($myrow = $xoopsDB->fetchArray($result)) { $amevent = array(); $amevent['event_id'] = $myrow['id']; $amevent['event_name'] = $myts->displayTarea($myrow['event_name'], 0, 0, 1, 0, 0); $amevent['event_date_start'] = format_date($myrow['event_date_start'], $xoopsModuleConfig['datefrmt']); $amevent['event_date_end'] = format_date($myrow['event_date_end'], $xoopsModuleConfig['datefrmt']); $amevent['event_duration'] = $myrow['event_duration']; $amevent['event_country'] = $myrow['event_country']; if($class == "even") { $class = "odd"; } else { $class = "even"; } $amevent['event_class'] = $class; if (!file_exists(XOOPS_ROOT_PATH ."/modules/amevents/images/flags/". $amevent['event_country'].".gif")) { //echo XOOPS_ROOT_PATH . "/modules/amevents/images/flags/" . $amevent['event_country']. ".gif<br>"; $amevent['event_country'] = "00"; } $xoopsTpl->append_by_ref('amevents', $amevent); unset($amevent); } // end while #unset($category); } // end if ############################################# # ########### include XOOPS_ROOT_PATH.'/include/comment_view.php'; include XOOPS_ROOT_PATH.'/footer.php'; ?> |
| tl001 | Posted: 2005/8/30 10:36 Updated: 2005/8/30 10:36 |
Webmaster ![]() ![]() Joined: 2004/6/10 From: Posts: 282 |
A pagetitle is for an individual event not for a list of events.
What you are doing is trying to assign a pagetitle to a list of events. $amevent['event_name'] = $myts->displayTarea($myrow['event_name'], 0, 0, 1, 0, 0); is an array and that is why you ended up with "['event_name']" |
| macmend | Posted: 2005/8/31 12:21 Updated: 2005/8/31 12:21 |
Just popping in ![]() ![]() Joined: 2005/8/21 From: Posts: 17 |
have only just tried your last suggestion...however it just comes up with -Object- in the title instead of the category
|
| tl001 | Posted: 2005/8/31 22:32 Updated: 2005/8/31 22:32 |
Webmaster ![]() ![]() Joined: 2004/6/10 From: Posts: 282 |
Sorry as I don't use it and can't help you further. I would suggest check the template file and php file to see how the category is assigned and go from there.
With or without the category should not be a big problem as pagetile tends to be cut off after certain number of characters. Hope you have fixed the PHPSessionID problem. I would fix it first then worry about everything else. PHPSessionID creates content duplication problem which may well get your site penalized. All the SEO efforts mean nothing if a site gets penalized. |
| macmend | Posted: 2005/9/1 8:15 Updated: 2005/9/1 8:29 |
Just popping in ![]() ![]() Joined: 2005/8/21 From: Posts: 17 |
google did rather go round my site a couple of hundred times and use up all my bandwidth
so I have added the following in the htaaccess file: php_flag session.use_trans_sid off but am not sure how I can check this works |
| tl001 | Posted: 2005/9/1 10:46 Updated: 2005/9/1 10:46 |
Webmaster ![]() ![]() Joined: 2004/6/10 From: Posts: 282 |
Quote:
php_flag session.use_trans_sid off seems to be working. To be sure, check your logs to see if items crawled by googlebots are clean of PHPSessionID. |
| ianez | Posted: 2006/4/5 13:23 Updated: 2006/4/5 13:23 |
Just popping in ![]() ![]() Joined: 2006/3/15 From: Posts: 12 |
I've same problem with mylinks...
I need to have the category path of module in the page title. Here's the code that make category_path in viewcat.php: I've tried $xoopsTpl->assign('xoops_pagetitle', $pathstring); but it return the long html link, while I need to have something like: SiteTitle: Link-category1: sub-category: how can I "clean" all this thanx IAn |
| tl001 | Posted: 2006/4/5 15:36 Updated: 2006/4/5 21:28 |
Webmaster ![]() ![]() Joined: 2004/6/10 From: Posts: 282 |
You will have to decipher the html link into readable plain text pieces and re-join them together.
The challenge is to break the mytree->getNicePathFromId It would be a very difficult task. I would suggest read the xoopstree function and then figure it out a way of breaking the three. Personally, I will not attempt at doing that at all. Maybe someone has better solutions? Anyone?? |
| ianez | Posted: 2006/4/11 20:16 Updated: 2006/4/11 20:16 |
Just popping in ![]() ![]() Joined: 2006/3/15 From: Posts: 12 |
I assume that breaking the tree coul have consequences on other modules...
I hope another solution is possible... I've tried changing it in $xoopsTpl->assign('xoops_pagetitle', $pathstring('title')); but it says the funciton () is undefined Ian |
| ianez | Posted: 2006/4/13 9:35 Updated: 2006/4/13 9:35 |
Just popping in ![]() ![]() Joined: 2006/3/15 From: Posts: 12 |
Working with the staff of Xoopsit (Italian Xoops Support) we finally find the way.
In a few I'll send a detailed tip and a pdf (the hack works also on other listing modules) have a nice easter Ian |
| macmend | Posted: 2006/11/14 11:04 Updated: 2006/11/14 11:06 |
Just popping in ![]() ![]() Joined: 2005/8/21 From: Posts: 17 |
I have played with this but don't get it, I want my title to be article title - Blog title
I have this code: I know this is the line that effects it but am not sure how to edit so that my page titles just have the name of the article and the name of the blog it can you help...? |






) I've been fiddling with it all day & the nearest I've got is for each event page to be called "['event_name']" with the brackets