PHP Web Host - Quality Web Hosting For All PHP Applications Free RavenNuke(tm) Add Ons
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
prekill
Worker
Worker


Joined: Oct 22, 2005
Posts: 186

PostPosted: Fri Feb 11, 2011 2:37 pm Reply with quote Back to top

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?
View user's profile Send private message
spasticdonkey
RavenNuke(tm) Development Team


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

PostPosted: Fri Feb 11, 2011 9:57 pm Reply with quote Back to top

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
View user's profile Send private message
neralex
Worker
Worker


Joined: Aug 22, 2007
Posts: 186
Location: Germany

PostPosted: Thu Jul 21, 2011 3:51 pm Reply with quote Back to top

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 Wink


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.

Crying or Very sad

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
View user's profile Send private message Visit poster's website
spasticdonkey
RavenNuke(tm) Development Team


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

PostPosted: Thu Jul 21, 2011 4:24 pm Reply with quote Back to top

Trying to refresh my memory, as it's been awhile Smile 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 Wink

Code:
if (is_admin($admin)){
   $dhID = $dh->getContentID();
   $dhCat = $dh->getCatID();
   $dhSubCat = $dh->getSubCatID();
   echo 'Category:'.$dhCat.' SubCategory:'.$dhSubCat.' Content:'.$dhID;
}
View user's profile Send private message
neralex
Worker
Worker


Joined: Aug 22, 2007
Posts: 186
Location: Germany

PostPosted: Thu Jul 21, 2011 4:43 pm Reply with quote Back to top

spasticdonkey,

yes its a long time ago but here look into the output:

Category:2 SubCategory:0 Content:1001
View user's profile Send private message Visit poster's website
spasticdonkey
RavenNuke(tm) Development Team


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

PostPosted: Thu Jul 21, 2011 5:31 pm Reply with quote Back to top

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
View user's profile Send private message
neralex
Worker
Worker


Joined: Aug 22, 2007
Posts: 186
Location: Germany

PostPosted: Thu Jul 21, 2011 7:13 pm Reply with quote Back to top

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
View user's profile Send private message Visit poster's website
neralex
Worker
Worker


Joined: Aug 22, 2007
Posts: 186
Location: Germany

PostPosted: Thu Jul 21, 2011 7:15 pm Reply with quote Back to top

RavensScripts
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic

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
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum