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 Issues
Author Message
prekill
Worker
Worker



Joined: Oct 22, 2005
Posts: 201

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

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: 1693
Location: Texas, USA

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

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 Visit poster's website
neralex
Site Admin



Joined: Aug 22, 2007
Posts: 1775

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

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
spasticdonkey







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

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;
}
 
neralex







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

spasticdonkey,

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

Category:2 SubCategory:0 Content:1001
 
spasticdonkey







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

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
 
neralex







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

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 
neralex







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

RavensScripts
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.4 RN Issues

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 ©