Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.4 RN Documentation
Author Message
wHiTeHaT
Life Cycles Becoming CPU Cycles



Joined: Jul 18, 2004
Posts: 579

PostPosted: Tue Feb 02, 2010 1:13 pm Reply with quote

What is the way to add dynamic page titles and mata tags from a new module and/ore single file in root?

I noticed in previous release something was changed abouth that.

Thanks in advance wHiTeHaT Wink


Last edited by wHiTeHaT on Fri Feb 05, 2010 6:05 pm; edited 1 time in total 
View user's profile Send private message Send e-mail
spasticdonkey
RavenNuke(tm) Development Team



Joined: Dec 02, 2006
Posts: 1693
Location: Texas, USA

PostPosted: Tue Feb 02, 2010 1:25 pm Reply with quote

I used the files in
includes/nukeSEO/dh

as examples on how to create my own on a per module basis. Each page or category of your module must have a unique id in the URL for the default dh system to work. URL's like
modules.php?name=SomeModule&file=somefile
are a little harder but there's a work-around that worked for me on the nukeSEO forums.
Moving forward from Dynamic Titles
http://nukeseo.com/modules.php?name=Forums&file=viewtopic&t=378

similar setup to the nukeSEO sitemap or mSearch if you have used those...


Last edited by spasticdonkey on Tue Feb 02, 2010 1:31 pm; edited 1 time in total 
View user's profile Send private message Visit poster's website
jakec
Site Admin



Joined: Feb 06, 2006
Posts: 3048
Location: United Kingdom

PostPosted: Tue Feb 02, 2010 1:29 pm Reply with quote

Load the block nukeSEOdh and you will then be able to control how the title is generated and override the meta tags.
 
View user's profile Send private message
wHiTeHaT







PostPosted: Tue Feb 02, 2010 1:33 pm Reply with quote

the titles for it are generated by a function within a class:

getPageTitle();
getPageTag();

i think in this case for me it would best to exclude the dynamic title/tags generation in ravennuke when ever this module or pages are loaded
 
wHiTeHaT







PostPosted: Tue Feb 02, 2010 2:34 pm Reply with quote

i'm still alittle confused , it seems the dynamic titles are generated from there own classes per module.
This means if there doesnt excist a class for a new added module , you must manualy enter this data into the db , using the nukeSEOdh block , correct?

I wonder if i'm forced to use nukeSEOdh? ( it seems it do).

i think it is a bad idea , but respecting the authors work , aloth of resource is used to generate or fetch this data.

I'm not happy with it Sad

in my point of view it would have been better to generate or fetch this data on a $link base , so for each $link with option to exclude links
$link
$ex_link
 
spasticdonkey







PostPosted: Tue Feb 02, 2010 2:40 pm Reply with quote

wHiTeHaT wrote:
.....This means if there doesnt excist a class for a new added module , you must manualy enter this data into the db , using the nukeSEOdh block , correct?


If you only want module level overrides then no extra files are needed. nukeDH will default them to
custom module title- sitename
(if i remember right), or you can override for the entire module.
 
wHiTeHaT







PostPosted: Tue Feb 02, 2010 4:21 pm Reply with quote

i'm not content with that , i require a full override.
It is to bad the default way is changed ( if i'm correct).
As you might now i work on oscommerce 3 , and finaly succeed to get the pagetitles meta tag's and keywords for all content as it it is generated in oscommerce , into nuke.

with 0 edits to (raven)nuke files , and only using the custom_mainfile.php
synced login/logout.

I spended weeks to find out the correct way , and feel a bit upset to find out i have to edit core files.
 
spasticdonkey







PostPosted: Tue Feb 02, 2010 4:39 pm Reply with quote

I'm not sure why you would have to edit core files?
You can override the function on a per module basis. Not familiar with OSCommerce, but you would just create a file
includes/nukeSEO/dh/dhOSCommerce.php

which would control how the OSCommerce module get's handled by nukeDH (where OSCommerce = name of your your module)

something like this but substitute the proper tables for OSCommerce (this was a copy of encyclopedia)
Code:


/************************************************************************/
/* nukeSEO
/* http://www.nukeSEO.com
/* Copyright 2008 by Kevin Guske
/************************************************************************/
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/
class dhOSCommerce extends dhclass {
   function dhOSCommerce () {
      global $prefix;
      $this->content_id        = 'tid';
      $this->content_table     = $prefix.'_encyclopedia_text';
      $this->contentTitleArray = array('title');
      $this->contentDescArray  = array('text');
      $this->contentKeysArray  = array('title','text');
      $this->cat_id            = 'eid';
      $this->cat_table         = $prefix.'_encyclopedia';
      $this->catTitleArray     = array('title');
      $this->catDescArray      = array('description');
      $this->catKeysArray      = array('title','description');
    // If pending content is stored in the same table, inactive content, private content, etc.
    $this->activeWhere       = '';
  }
  function getContentID() {
    global $tid;
    return $tid;
  }
  function setContentID() {
      global $tid, $dhID;
      $tid = $dhID;
   }
  function getCatID() {
    global $eid;
    return $eid;
  }
   function setCatID() {
      global $eid, $dhCat;
      $eid = $dhCat;
   }
}
 
wHiTeHaT







PostPosted: Tue Feb 02, 2010 4:48 pm Reply with quote

yes your right abouth that Spas , however the way i intregrated oscommerce to nuke isnt like a real module.

I have created a module called oscommerce as a pin-point for nuke , but to respect also oscommerce code , it's 'content'-files are located in the root of nuke.
The only file in the oscommerce module what can be entered is it's index.php.
From there it refers to it's other files.
-account.php
-checkout.php
-download.php
-images.php
-info.php
-products.php
-redirect.php
-search.php
-shop.php (represents index.php)
each of these files have titles generated etc.
So beside the current methode to create the dynamic titles etc etc... this would have been an issue anyway , but one i could resolve quickly.

So a url like http://demov3.osc2nuke.com/modules.php?name=oscommerce&file=XXXX doesnt excist.
only: http://demov3.osc2nuke.com/modules.php?name=oscommerce&file=index
 
spasticdonkey







PostPosted: Tue Feb 02, 2010 5:45 pm Reply with quote

looking very nice... and yes and I see you have some challenges ahead since it isn't passed through modules.php
there may be some options in
includes/nukeSEO/dh/dhDefault.php

by overriding the default getHEAD function when needed.
 
wHiTeHaT







PostPosted: Wed Feb 03, 2010 3:53 pm Reply with quote

i checked the includes/nukeSEO/dh/dhDefault.php

but there i see only a complete quoted file , if i try to use it as i think i should , it doesnt work.

Code:


<?php
/************************************************************************/
/* nukeSEO
/* http://www.nukeSEO.com
/* Copyright 2008 by Kevin Guske
/************************************************************************/
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/
class dhoscommerce extends dhclass {
   function dhoscommerce () {
#      global $prefix;
#      $this->content_id        = 'fid';
#      $this->content_table     = $prefix.'_seo_feed';
#      $this->contentTitleArray = array('title');
#      $this->contentDescArray  = array('desc');
#      $this->contentKeysArray  = array('title','desc');
    // If pending content is stored in the same table, inactive content, private content, etc.
#    $this->activeWhere       = 'active = 1';
  }
  // Override default getHEAD function
  function getHEAD() {
         $meta['title'][1] = $name . ' - '.$sitename . ' - ' . $slogan;
         $meta['Content-Script-Type'] = array('http-equiv','text/javascript',0);
         $meta['Content-Style-Type'] = array('http-equiv','text/css',0);
         $meta['Expires'] = array('http-equiv','0',0);
         $meta['RESOURCE-TYPE'] = array('name','DOCUMENT',0);
         $meta['DISTRIBUTION'] = array('name','GLOBAL',0);
         $meta['AUTHOR'] = array('name',$sitename,0);
         $meta['COPYRIGHT'] = array('name','Copyright (c) by '.$sitename,0);
         $meta['DESCRIPTION'] = array('name',$slogan,0);
         $meta['KEYWORDS'] = array('name','CMS, cms, Best CMS, best cms, Raven, RavenNuke, Raven Nuke, raven, ravennuke, raven nuke, scripts, PHP, php, MySQL, mysql, SQL, sql, News, news, Technology, technology, Headlines, headlines, Nuke, nuke, PHP-Nuke, phpnuke, php-nuke, Linux, linux, Windows, windows, Software, software, Download, download, Downloads, downloads, Free, FREE, free, Community, community, Forum, forum, Forums, forums, Bulletin, bulletin, Board, board, Boards, boards, Survey, survey, Comment, comment, Comments, comments, Portal, portal, ODP, odp, Open, open, Open Source, OpenSource, Opensource, opensource, open source, Free Software, FreeSoftware, Freesoftware, free software, GNU, gnu, GPL, gpl, License, license, Unix, UNIX, *nix, unix, Database, DataBase, Blogs, blogs, Blog, blog, database, Programming, programming, Web Site, web site, Weblog, WebLog, weblog, ',0);
         $meta['REVISIT-AFTER'] = array('name','1 DAYS',0);
         $meta['RATING'] = array('name','GENERAL',0);
  }
}


If this file should work as you would expect it to do ( changed the class name for the module)
 
kguske
Site Admin



Joined: Jun 04, 2004
Posts: 6437

PostPosted: Wed Feb 03, 2010 8:13 pm Reply with quote

Just a suggestion...since osCommerce isn't integrated as a module and PHP classes seem to be a challenge, why not use the page title and meta tag generation functions in osCommerce?

_________________
I search, therefore I exist...
Only registered users can see links on this board! Get registered or login!
 
View user's profile Send private message
wHiTeHaT







PostPosted: Thu Feb 04, 2010 1:07 pm Reply with quote

these are the one i use.
But i not use oscommerce's header/footer but raven's.

but what abouth why above not work?
 
Guardian2003
Site Admin



Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam

PostPosted: Fri Feb 05, 2010 2:52 am Reply with quote

If you are not porting oscommerce as a module, then you cannot realistically expect it to work as some native RN functions might not be available.
If you are just using RN's header/footer to wrap oscommerce you are probably missing vital components like mainfile.php
As kguske already mentioned, you might be better retaining RN header/footer to give oscommerce the appearence of RN but just use the oscommerce meta tag generation.
Either that or use oscommerce as a stand alone, tweak the theme to match your RN theme and build a simple bridge to share user data.
 
View user's profile Send private message Send e-mail
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Fri Feb 05, 2010 7:20 am Reply with quote

wHiTeHaT wrote:
It is to bad the default way is changed ( if i'm correct).


Not correct! Sort-of... Yes, it is changed from using my Dynamic Titles script to nukeSEO DH, but the concept is exactly the same. If you were to add a new module the old way, you would have had to update the includes/dynamic_titles.php script to include whatever overrides you wanted for the titles because the data must be pulled from the module's tables in order to be "dynamic". Wink

So, instead of modifying this script, you create a class for your module.

_________________
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! 
View user's profile Send private message Visit poster's website
wHiTeHaT







PostPosted: Fri Feb 05, 2010 12:58 pm Reply with quote

Guardian2003 wrote:
If you are not porting oscommerce as a module, then you cannot realistically expect it to work as some native RN functions might not be available.
If you are just using RN's header/footer to wrap oscommerce you are probably missing vital components like mainfile.php
As kguske already mentioned, you might be better retaining RN header/footer to give oscommerce the appearence of RN but just use the oscommerce meta tag generation.
Either that or use oscommerce as a stand alone, tweak the theme to match your RN theme and build a simple bridge to share user data.


Al the RN functions work as it should do , the point is ,oscommerce uses it's own dynamic titles and keywords.
So if i goto a product , it generate keywords and if has tags for this product.

Image
 
wHiTeHaT







PostPosted: Fri Feb 05, 2010 4:46 pm Reply with quote

this is the result of the old methode (default nuke way) , works as expected:

Image
 
wHiTeHaT







PostPosted: Fri Feb 05, 2010 6:04 pm Reply with quote

a change is made to the header.php to load default nuke standard for the oscommerce part.
and if it isnt part of oscommerce , load the dh class

Problem solved.
 
nuken
RavenNuke(tm) Development Team



Joined: Mar 11, 2007
Posts: 2024
Location: North Carolina

PostPosted: Fri Feb 05, 2010 6:09 pm Reply with quote

I am glad you were able to solve this.

_________________
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.4 RN Documentation

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©