<?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';
}
}
?>
Joined: Dec 02, 2006 Posts: 1361 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..
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;
Joined: Dec 02, 2006 Posts: 1361 Location: Texas, USA
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
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