Author |
Message |
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 2:37 pm |
|
Found the Solution!! :
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 $file, $id;
$rid = 0;
if ($file == 'index') $rid= 0;
elseif ($file == 'rev') $rid = $id;
return $rid;
}
function setContentID() {
global $file, $dhID;
if ($dhID == 0) $file = 'index';
elseif ($dhID == 1) $file = 'rev';
}
function getCatID() {
global $file, $id;
$cid = 0;
if ($file == 'index') $cid= 0;
elseif ($file == 'cat') $cid = $id;
return $cid;
}
function setCatID() {
global $file, $dhID;
if ($dhID == 0) $file = 'index';
elseif ($dhID == 1) $file = 'cat';
}
}
?>
|
For now its seems ok, What do you think? |
|
|
|
![](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:
Fri Feb 11, 2011 9:57 pm |
|
not familiar with mreviews so can't say for sure. I will say that this forum thread isn't exactly the best example to follow for building a dh file, as we are using it in a way it was not exactly designed for..
but hey, if it's working... ![Smile](modules/Forums/images/smiles/icon_smile.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
neralex
Site Admin
![](modules/Forums/images/avatars/201442295664a46e4575d46.jpg)
Joined: Aug 22, 2007
Posts: 1775
|
Posted:
Thu Jul 21, 2011 3:51 pm |
|
spasticdonkey wrote: | 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 |
hey spasticdonkey,
i need your help, too.
i tried this with a little bit of changes.
it works, i can override the ids separatly but if i load the seo colorbox, then i become no output of the overrided title and can't delete them.
if i go back to a Cat, then i can see and delete the overrided things in the colorbox. how can i fix it?
Code:function getContentID() {
global $file, $id;
$plusSize=0;
if ($file == 'index'){
return $id;
}
elseif ($file == 'shedule'){
if ($id>=1) $plusSize = 10000;
}
elseif ($file == 'team'){
if ($id>=1) $plusSize = 1000;
}
return $id+$plusSize;
}
function setContentID() {
global $id, $dhID, $plusSize;
// if ($id>=1) $plusSize = 1000;
$id = $dhID;
}
function getCatID() {
global $file, $id;
$cid = 0;
if ($file == 'index') {
$cid = 0;
} elseif ($file == 'shedule') {
$cid = 1;
} elseif ($file == 'team') {
$cid = 2;
} elseif ($file == 'wish') {
$cid = 3;
}
return $cid;
}
function setCatID() {
global $file, $dhCat, $id;
if ($dhCat == 0) {
} elseif ($dhCat == 1) {
$file = 'shedule';
} elseif ($dhCat == 2) {
$file = 'team';
} elseif ($dhCat == 3) {
$file = 'wish';
}
}
|
greets |
Last edited by neralex on Thu Jul 21, 2011 7:19 pm; edited 1 time in total |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
spasticdonkey
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Jul 21, 2011 4:24 pm |
|
Trying to refresh my memory, as it's been awhile Just for anyone following along this is not the preferred method of creating a dh file, and should only be used if your module content is not stored in the sql database.
You probably need to add some logic that prevents the $dhCat and $dhID from both being greater than 0. Only one of the dh values can be greater than 0 for the system to function correctly.. I would suggest checking if the value of $id is greater than 0 in your category functions, and if so set $dhCat as 0.
You could add something like this in your module to help debug.. i didn't try it but it should work
Code:if (is_admin($admin)){
$dhID = $dh->getContentID();
$dhCat = $dh->getCatID();
$dhSubCat = $dh->getSubCatID();
echo 'Category:'.$dhCat.' SubCategory:'.$dhSubCat.' Content:'.$dhID;
}
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
neralex
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Jul 21, 2011 4:43 pm |
|
spasticdonkey,
yes its a long time ago but here look into the output:
Category:2 SubCategory:0 Content:1001 |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
spasticdonkey
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Jul 21, 2011 5:31 pm |
|
see if this helps
Code:function getCatID() {
global $file, $id;
$cid = 0;
if(!isset($id)) { $id = 0; }
if ($file == 'index') {
$cid = 0;
} elseif ($file == 'shedule' AND $id == 0) {
$cid = 1;
} elseif ($file == 'team' AND $id == 0) {
$cid = 2;
} elseif ($file == 'wish' AND $id == 0) {
$cid = 3;
}
return $cid;
}
|
hopefully that will give you
Category:0 SubCategory:0 Content:1001
and start working ![Wink](modules/Forums/images/smiles/icon_wink.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
neralex
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Jul 21, 2011 7:13 pm |
|
Category:0 SubCategory:0 Content:1001
it works! issue complete! thanks a lot spasticdonkey!!!! |
Last edited by neralex on Thu Jul 21, 2011 7:18 pm; edited 2 times in total |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
neralex
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Jul 21, 2011 7:15 pm |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
|