Author |
Message |
neralex
Site Admin
![](modules/Forums/images/avatars/201442295664a46e4575d46.jpg)
Joined: Aug 22, 2007
Posts: 1775
|
Posted:
Mon Jan 31, 2011 10:38 pm |
|
hey!
i have a simple module and i want set a own codebased pagetitle (title in the browser bar) for all modulesites separately. how do i set this in the following lines? or is it needed to create a new dhClass file in the includes folders of the RN? is the last thing to do, where i can find instructions? (note: the content infos come from an external database as frontend view in this nuke module)
Code:if (!defined('MODULE_FILE')) die('You can\'t access this file directly...');
require_once('mainfile.php');
$module_name = basename(dirname(__FILE__));
get_lang($module_name);
function index() {
global $module_name;
include("header.php");
OpenTable();
echo "<center><a href=\"modules.php?name=".$module_name."&op=test\">test</a></center>";
CloseTable();
include("footer.php");
}
function test() {
global $module_name, $pagetitle, $sitename, $slogan;
// needed pagetitle here?!
include("header.php");
OpenTable();
echo "<center><a href=\"modules.php?name=".$module_name."\">index</a></center>";
CloseTable();
OpenTable();
echo "test";
// include("modules/".$module_name."/test.php");
CloseTable();
include("footer.php");
}
if (!isset($op)) { $op = ""; }
switch($op) {
case "test":
test();
break;
default:
index();
break;
}
|
greets. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
spasticdonkey
RavenNuke(tm) Development Team
![](modules/Forums/images/avatars/48fb116845dfecf66294c.gif)
Joined: Dec 02, 2006
Posts: 1693
Location: Texas, USA
|
Posted:
Tue Feb 01, 2011 3:42 pm |
|
Yes it would be best to create a dh file for your module. Although this system is intended to work with modules that have id numbers for their category, subcategory, and content level content. If it's just a simple two page module I would probably just split it into two files, you you can assign a content id to each.
modules/Some_Module/index.php
Code:if (!defined('MODULE_FILE')) die('You can\'t access this file directly...');
require_once('mainfile.php');
$module_name = basename(dirname(__FILE__));
get_lang($module_name);
include("header.php");
OpenTable();
echo "<center><a href=\"modules.php?name=".$module_name."&op=test\">test</a></center>";
CloseTable();
include("footer.php");
|
modules/Some_Module/somefile.php
Code:if (!defined('MODULE_FILE')) die('You can\'t access this file directly...');
require_once('mainfile.php');
$module_name = basename(dirname(__FILE__));
get_lang($module_name);
include("header.php");
OpenTable();
echo "<center><a href=\"modules.php?name=".$module_name."\">index</a></center>";
CloseTable();
OpenTable();
echo "test";
// include("modules/".$module_name."/test.php");
CloseTable();
include("footer.php");
|
then create a corresponding dh file, with a hack to set the content id since you are not pulling it from the db.
includes/nukeSEO/dh/dhSome_Module.php
Code:class dhSome_Module extends dhclass {
function getContentID() {
global $file;
$cid = 0;
if ($file == 'index') $cid= 0;
elseif ($file == 'somefile') $cid = 1;
return $cid;
}
function setContentID() {
global $file, $dhID;
if ($dhID == 0) $file = 'index';
elseif ($dhID == 1) $file = 'somefile';
}
}
|
You should then have options with the nukenav seo modal window and/or block. Obviously replace "Some_Module" and "somefile" as needed
btw, you would access file #2 @
modules.php?name=Some_Module&file=somefile |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
neralex
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue Feb 01, 2011 4:22 pm |
|
hey spasticdonkey,
thanks for your reply and your cool solution. but i need my version with the op-sites. i have many more pages with the op-cases in my module. if i use your solution, then i must change all functions. give it a way to rewrite this snippet to my op's? |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
neralex
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue Feb 01, 2011 7:48 pm |
|
mr. spasticdonkey, hold on!
i have changed all my $op's to $file's for all functions and it works great!
note: this is it, what i like here! if i have a question and then comes a snippet. i try it and it will not work in 1st try. but if i test it intensive, then is it a trendsetting solution.
![RavensScripts](modules/Forums/images/smiles/ravensphpscripts.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
spasticdonkey
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue Feb 01, 2011 8:47 pm |
|
not sure if it will work without some tinkering, but you might experiment with something like this. If it doesn't work, try giving your default op a case name and see if that helps.
Code:class dhSome_Module extends dhclass {
function getContentID() {
global $op;
$cid = 0;
switch ($op) {
default:
$cid = 0;
break;
case 'test':
$cid = 1;
break;
}
return $cid;
}
function setContentID() {
global $dhID;
if ($dhID == 0) $op = '';
elseif ($dhID == 1) $op = 'test';
}
}
|
EDIT: looks like i should have refreshed the page before posting... glad you got it working ![Smile](modules/Forums/images/smiles/icon_smile.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
neralex
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Feb 02, 2011 5:32 pm |
|
btw... your 2nd snippet works, too!
thank you! |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
neralex
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Feb 03, 2011 10:28 pm |
|
hey spasticdonkey, i need your help again, please...
i have a &file= page with a loop and i want set a new cid to my sub content-id site. in my example works the cid=3 in the dh-file. but if go to this site, then is cid=3 (presumably) indicated as cid=0 (example: %sitename% - %slogan% - %module%). if i try to override the pagetitle with the SEO button from nukeNAV, then my settings are set before the $dh_sModSuffix. (example: test - %sitename% - %slogan% - %module%) how can i override this correctly?
modules/Some_Module/somefile2.php
Code:if (!defined('MODULE_FILE')) die('You can\'t access this file directly...');
require_once('mainfile.php');
$module_name = basename(dirname(__FILE__));
get_lang($module_name);
include("header.php");
if(isset($_GET['id'])) {
OpenTable()
echo "sub content-id site";
// $cid = 3; needed?
// url: modules.php?name=Some_Module&file=somefile2&id=1
CloseTable();
} else {
OpenTable()
echo "main content site";
// $cid = 2; was set and works in the dh file
// url: modules.php?name=Some_Module&file=somefile2
CloseTable();
}
include("footer.php");
|
includes/nukeSEO/dh/dhSome_Module.php
Code:
class dhSome_Module extends dhclass {
function getContentID() {
global $file;
$cid = 0;
if ($file == 'index') {
$cid = 0;
} elseif ($file == 'somefile') {
$cid = 1;
} elseif ($file == somefile2' && isset($_GET['id'])) {
$cid = 3;
} elseif ($file == 'somefile2') {
$cid = 2;
// if ($file == 'somefile2' && isset($_GET['id'])) {
// $cid = 3;
// } else {
// $cid = 2;
// }
}
return $cid;
}
function setContentID() {
global $file, $dhID;
if ($dhID == 0) {
$file = 'index';
} elseif ($dhID == 1) {
$file = 'somefile';
} elseif ($dhID == 3) {
$file == 'somefile2' && isset($_GET['id']);
} elseif ($dhID == 2) {
$file = 'somefile2';
}
}
}
|
greetz |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
spasticdonkey
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Fri Feb 04, 2011 12:32 am |
|
neralex wrote: | hey spasticdonkey, i need your help again, please...
i have a &file= page with a loop and i want set a new cid to my sub content-id site. in my example works the cid=3 in the dh-file. but if go to this site, then is cid=3 (presumably) indicated as cid=0 (example: %sitename% - %slogan% - %module%). if i try to override the pagetitle with the SEO button from nukeNAV, then my settings are set before the $dh_sModSuffix. (example: test - %sitename% - %slogan% - %module%) how can i override this correctly?
modules/Some_Module/somefile2.php
Code:if (!defined('MODULE_FILE')) die('You can\'t access this file directly...');
require_once('mainfile.php');
$module_name = basename(dirname(__FILE__));
get_lang($module_name);
include("header.php");
if(isset($_GET['id'])) {
OpenTable()
echo "sub content-id site";
// $cid = 3; needed?
// url: modules.php?name=Some_Module&file=somefile2&id=1
CloseTable();
} else {
OpenTable()
echo "main content site";
// $cid = 2; was set and works in the dh file
// url: modules.php?name=Some_Module&file=somefile2
CloseTable();
}
include("footer.php");
|
includes/nukeSEO/dh/dhSome_Module.php
Code:
class dhSome_Module extends dhclass {
function getContentID() {
global $file;
$cid = 0;
if ($file == 'index') {
$cid = 0;
} elseif ($file == 'somefile') {
$cid = 1;
} elseif ($file == somefile2' && isset($_GET['id'])) {
$cid = 3;
} elseif ($file == 'somefile2') {
$cid = 2;
// if ($file == 'somefile2' && isset($_GET['id'])) {
// $cid = 3;
// } else {
// $cid = 2;
// }
}
return $cid;
}
function setContentID() {
global $file, $dhID;
if ($dhID == 0) {
$file = 'index';
} elseif ($dhID == 1) {
$file = 'somefile';
} elseif ($dhID == 3) {
$file == 'somefile2' && isset($_GET['id']);
} elseif ($dhID == 2) {
$file = 'somefile2';
}
}
}
|
greetz |
$dh_sModSuffix is supposed to come at the end of the module level override (your module home page / index). It's adding it because it is not able to find a valid subcat, cat, on content id.
You cannot use $_GET in the manner you have, that may be why.
This was a hack to assign content level id's based on the $file. If you are adding another layer of content ($id) to the module we may need to alter our approach.
Undo some of your recent changes, back to what was working
Then change your function getContentID to getCatID, and setContentID to setCatID. We will redo the getContentID and setContentID to recognize your $id level content.
Code: function getContentID() {
global $id;
return $id;
}
function setContentID() {
global $id, $dhID;
$id = $dhID;
}
function getCatID() {
// your previous getContentID code goes here, it will now be category level
}
function setCatID() {
// your previous setContentID code goes here, it will now be category level
}
|
btw, if it does not recognize the id, then it is likely not set properly in your module.
On a related note, If you enjoy tinkering like this, I would highly recommend using Guardian's nuke debugger, which will help show undeclared variables, sql errors, and a bunch of other cool stuff
http://www.code-authors.com/shop/view-item/16-CA-PHP-Debugger-v103.html |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
neralex
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Fri Feb 04, 2011 7:55 am |
|
thank you!! |
Last edited by neralex on Fri Feb 04, 2011 7:05 pm; edited 1 time in total |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
neralex
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Fri Feb 04, 2011 7:04 pm |
|
hey spasticdonkey, i need you again...
in the $ids are working the overrides correct! the CatIds was set, too. but if i try override a CatId, then was all CatIds overrided with the same and the mod_suffix was set after my settings. what is the problem?
Code:class dhSame_Module extends dhclass {
function getContentID() {
global $id;
return $id;
}
function setContentID() {
global $id, $dhID;
$id = $dhID;
}
function getCatID() {
// your previous getContentID code goes here, it will now be category level
global $file;
$cid = 0;
if ($file == 'index') {
$cid = 0;
} elseif ($file == 'somefile') {
$cid = 1;
} elseif ($file == 'somefile2') {
$cid = 2;
}
return $cid;
}
function setCatID() {
// your previous setContentID code goes here, it will now be category level
global $file, $dhID;
if ($dhID == 0) {
$file = 'index';
} elseif ($dhID == 1) {
$file = 'somefile';
} elseif ($dhID == 2) {
$file = 'somefile2';
}
}
}
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
neralex
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Fri Feb 04, 2011 7:30 pm |
|
i have change $dhID in setCatID to $dhCat.
Code:class dhSame_Module extends dhclass {
function getContentID() {
global $id;
return $id;
}
function setContentID() {
global $id, $dhID;
$id = $dhID;
}
function getCatID() {
global $file;
$cid = 0;
if ($file == 'index') {
$cid = 0;
} elseif ($file == 'somefile') {
$cid = 1;
} elseif ($file == 'somefile2') {
$cid = 2;
}
return $cid;
}
function setCatID() {
global $file, $dhCat;
if ($dhCat== 0) {
$file = 'index';
} elseif ($dhCat== 1) {
$file = 'somefile';
} elseif ($dhCat== 2) {
$file = 'somefile2';
}
}
}
|
but now it's the other way around... now i can override the CatIDs but a override of a $id change all ids. if i override id=1 in cat=1, then was my stettings displayed in id=1 of cat=2, too.
![Image Image](http://www.abload.de/thumb/340x_futurama-brain-sl0mv3.jpg) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
spasticdonkey
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Fri Feb 04, 2011 11:11 pm |
|
your right it should have been $dhCat
I'm kinda working blind here, but what does it say in the SEO modal window? It should say "Content Override Tag" when you are on the $id level of content. If it says "Module Override Tag" then it is not properly detecting the $id, and assumes it is on the module homepage.
It could also be that how we are doing this is flawed. It may be detecting both a cat id and a content id, which it shouldn't. Just curious, but what happens if you try this in your module
echo getContentID();
echo getCatID();
and see what values are assigned. One or the other should be 0, no matter which page you are on... If not, we have a problem
you could also try this
Code: function getCatID() {
global $file, $id;
$cid = 0;
if (!isset($id)) {
$id = 0;
}
if (($file == 'index') AND ($id == 0)) {
$cid = 0;
} elseif (($file == 'somefile') AND ($id == 0)) {
$cid = 1;
} elseif (($file == 'somefile2') AND ($id == 0)) {
$cid = 2;
}
return $cid;
}
|
and that may help |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
neralex
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sat Feb 05, 2011 12:55 am |
|
...okay your last snippet set the target of any ids to $dhID and it don't set a CatID.
we go back to my last changes. (german lang used)
if i go to $id of a CatID, then say it "Content Override Tag".
if i go to the CatID, then say it "Kategorie Override Tag".
all cool here, or not?!
the overrides the CatIDs works fine. if i go to $id of a CatID, it was show the pagetitle of the CatID. but if i override id=1 of cat=1, then show the same setting in id=1 of cat=2. is the difference of id=1 of cat=1 or cat=2 the problem?
NOTE: in somefile and somefile2 are the same isset($_GET['id']) loop with different functions and sql-calls.
but if i try to echo getContentID(); or echo getCatID();, then i become: a Fatal error " Call to undefined function getContentID()" or "Call to undefined function getCatID()". i have added it after the header-includes and i have try it to add this in my included module files with the isset loop. in the isset loop was stopped the php file and the footer or the right blocks are not displayed. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
spasticdonkey
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sat Feb 05, 2011 7:34 am |
|
Yes as to the fatal error, I told you incorrectly.. this should work, try this somewhere after mainfile and header are included
Code:$whodatCat = $dh->getCatID();
$whatdatItem = $dh->getContentID();
echo 'Category: '.$whodatCat;
echo '<br />';
echo 'Content: '.$whatdatItem;
|
and see what it says on the problem pages. then maybe we can figure out what is going on. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
neralex
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sat Feb 05, 2011 11:59 am |
|
okay... let me show you the output!
modules.php?name=Some_Module&file=somefile:
Category: 1
Content:
modules.php?name=Some_Module&file=somefile&id=1:
Category: 1
Content: 1
modules.php?name=Some_Module&file=somefile&id=2:
Category: 1
Content: 2
modules.php?name=Some_Module&file=somefile2:
Category: 2
Content:
modules.php?name=Some_Module&file=somefile2&id=1:
Category: 2
Content: 1
modules.php?name=Some_Module&file=somefile2&id=2:
Category: 2
Content: 2 |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
spasticdonkey
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sat Feb 05, 2011 12:20 pm |
|
that's what i was afraid of. they should not both have a value > 0
i take it those are the pages that are not working
i have to go to work...
might be tomorrow before i'm on again.. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
spasticdonkey
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sun Feb 06, 2011 1:29 pm |
|
See if this works, we need to make sure the category is 0 when an $id level content is viewed.
Code:function getCatID() {
global $file, $id;
$cid = 0;
if ((!is_null($id)) OR ($id<1)) {
if ($file == 'index'){
$cid = 0;
}
elseif ($file == 'somefile'){
$cid = 1;
}
elseif ($file == 'somefile2'){
$cid = 2;
}
}
return $cid;
}
|
i can't test it, so see what happens ![Smile](modules/Forums/images/smiles/icon_smile.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
neralex
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon Feb 07, 2011 5:13 pm |
|
hey spasticdonkey!
your code it is displayed and worked exactly as before.
i can override the categories correct. CAT 1 and CAT 2 is this distinction between correct and saved as this. if go to ID 1 of CAT 1, then was displayed the title from CAT 1. this works as well in CAT 2 and the title from CAT 2 was displayed in ID 1 from CAT 2. but if go to ID 1 from CAT 1 and override the title, then was displayed the title in ID 1 of CAT 2. if go to ID 2 from CAT 1 and override the title, then was displayed the title in ID 2 of CAT 2 and the other way around, too. oO
again for me to understand:
i can only be a title to write when i'm on the lowest level? can be a title of a category not be overwritten, that it be shown with the underlying at the level and adds another override at this level, the title of the category?
again for you to understand:
this module is a radio-shedule with a teamlisting. the content comes from another database/user outside of the nuke but on the same localhost.
index.php: note used at the moment, its a redirect to &file=somefile
somefile.php: here is the shedule loop.
somefile2.php: here is the userlist loop.
Code:if(isset($_GET['id'])) {
// somefile&id=1: here was displayed the content from a show id (Category: 1, Content: 1)
// somefile2&id=1: here was displayed the content from a user id (Category: 2, Content: 1)
} else {
// somefile: here was displayed the content from the shedule (Category: 1, Content: )
// somefile2: here was displayed the content from the userlist (Category: 2, Content: )
}
|
greetz |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
neralex
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon Feb 07, 2011 7:02 pm |
|
i have test it a little bit...
Code:function getCatID() {
global $file, $id;
$cid = 0;
if ((!is_null($id)) OR ($id<1)) {
if ($file == 'index') {
$cid = 0;
}
elseif ($file == 'shedule') {
if (($id>0)) {
// unset($cid[1]);
$cid = 0;
} else {
$cid = 1;
}
}
elseif ($file == 'team') {
$cid = 2;
}
}
return $cid;
}
|
...CatID is 0, if i viewing the somefile content ids. but now i can set the title only to the $dhID.
SEO link after this change:
Code:modules.php?name=nukeNAV&op=SEO&dhName=Some_Module&dhID=1
|
SEO link before this change:
Code:modules.php?name=nukeNAV&op=SEO&dhName=Some_Module&dhID=1&dhCat=1
|
the prob is now the second $id from the somefile2.php loop. it goes to the same dhID. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
spasticdonkey
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue Feb 08, 2011 9:14 am |
|
sorry man, been busy and have not had another opportunity to look at this.
If you can zip up the module and PM me a link I will take another look. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
neralex
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Feb 09, 2011 6:45 pm |
|
its ok - np. thank for your help.
@rest of RN Dev-Team:
give it a full documentation of this nukeSEO addon? i found on nukeSEO a little FAQ: Only registered users can see links on this board! Get registered or login!
at that time in the old NUKE there was a array, its called $pagetitle. is there still or why was it totally removed?
greetz |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
spasticdonkey
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Feb 09, 2011 9:58 pm |
|
neralex wrote: | its ok - np. thanks for your help. all steps to this module can you find here in this thread. if need more, write me what you need.
@rest of RN Dev-Team:
give it a full documentation of this nukeSEO addon? its cool for all original RN modules but if you create a own module it is a hard problem to change the title. i found on nukeSEO a little FAQ: Only registered users can see links on this board! Get registered or login!
at that time in the old NUKE there was a array, its called $pagetitle. is there still or why was it totally removed? nevertheless, i would like to put only one easy pagetitle in module. it is a great pity ones that easy titles such an expenditure needed...
greetz |
well it has been a little harder than it needs to be.. remember we are using this system in a way that it was NOT designed to be used, and I also have been working somewhat in the dark trying to help you; w/o being able to test anything, and learning your module structure as we go. if your module wasn't using an external db things could be much easier as well...
but don't get discouraged, I think we are close.
try this
Code:function getCatID() {
global $file, $id;
$cid = 0;
if ($id<1) {
if ($file == 'index'){
$cid = 0;
}
elseif ($file == 'somefile'){
$cid = 1;
}
elseif ($file == 'somefile2'){
$cid = 2;
}
}
|
as for the documentation, i understand what you are saying.. only so much time in the day, and many projects on the board. I have some tutorials in the works that will be available at some point in the not-too-distant future. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
neralex
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Feb 10, 2011 1:25 am |
|
ok, cool. i will try it tomorrow!
the dh classes are very awesome and it make it fun to play with it. but its very crazy to use. here in germany i would say: gehirnschnecke. in english say it google trans: brainsnail.
i make tomorrow a complete zip of my test module for you. i think we don't need no database for this example. my prob is in a stand a lone php scipt, what should also remain so.
can i set in dh class file a sql-connect to another database as from the nuke or must i set this in my module files?
yes...we are near at the solution. but i think, we need a way to compare the IDs of the CATs. ![Smile](modules/Forums/images/smiles/icon_smile.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
spasticdonkey
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Feb 10, 2011 10:30 am |
|
i think the latest tweak will work to a degree, but we will run into another problem.
somefile&id=1: (Category: 1, Content: 1)
somefile2&id=1: (Category: 2, Content: 1)
we cannot use the content id of 1 for two different pages within the same module. the DH system needs an id that will be unique to a single page. How about we assign content id's of 1-99 for somefile, 100-199 for somefile2, etc...
Code: function getContentID() {
global $file, $id;
$plusSize=0;
if ($file == 'somefile'){
return $id;
}
elseif ($file == 'somefile2'){
if ($id>=1) $plusSize = 100;
}
elseif ($file == 'somefile3'){
if ($id>=1) $plusSize = 200;
}
return $id+$plusSize;
}
|
This will limit you to 100 pages or less in each section, but you can increase/decrease $plusSize as needed. But do it now, not later. If you change later you would have to redo most of your saved SEO overrides as the $id would change for many of the content items
as for pulling the info from an external db, it may be possible, but I have never tried it and wouldn't know where to tell you to start.
try these latest couple of changes before you start creating a zip file for me, we may be there ![Wink](modules/Forums/images/smiles/icon_wink.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
prekill
Worker
![Worker Worker](modules/Forums/images/ranks/3stars.gif)
![](modules/Forums/images/avatars/gallery/blank.gif)
Joined: Oct 22, 2005
Posts: 201
|
Posted:
Fri Feb 11, 2011 1:58 pm |
|
ummm
I am using the following module: mreviews
its URL stacture is like this:
category:
modules.php?name=mreviews&file=cat&id=344
content:
modules.php?name=mreviews&file=rev&id=306
I have created the following: dhmreviews.php in includes/nukeSEO/dh
but the title is not changing for some reason.
this is dhmreviews.php:
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 dhmreviews extends dhclass {
function dhmreviews () {
global $prefix;
$this->content_id = 'rid';
$this->content_table = 'nuke_mreviews';
$this->contentTitleArray = array('pagename');
$this->contentDescArray = array('content');
$this->contentKeysArray = array('pagename','content');
$this->cat_id = 'cid';
$this->cat_table = 'nuke_mreviews_cats';
$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 $rid;
return $rid;
}
function setContentID() {
global $rid, $dhID;
$rid = $dhID;
}
function getCatID() {
global $cid;
return $cid;
}
function setCatID() {
global $cid, $dhCat;
$cid = $dhCat;
}
}
?>
|
any clue why?
I am gussing I have &file=cat in the url..
Can it be fixed? |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
|