Montego Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic
Author Message
spasticdonkey
Newbie
Newbie



Joined: Sep 05, 2007
Posts: 78

PostPosted: Thu Jul 22, 2010 9:11 am Reply with quote

For anyone interested heres the tap for
Nuke Docs v1 beta for RavenNuke
http://www.nukecoder.com/shop_item-12.html

ShortLinks/GT-Docs.php

Code:
<?php

$urlin = array(
  '"(?<!/)modules.php\?name=Docs&amp;do=show_doc&amp;id=([0-9]*)&amp;edit_doc=([0-9]*)"',
  '"(?<!/)modules.php\?name=Docs&amp;do=show_doc&amp;id=([0-9]*)&amp;cat=([0-9]*)"',
  '"(?<!/)modules.php\?name=Docs&amp;do=show_doc&amp;id=([0-9]*)"',
  '"(?<!/)modules.php\?name=Docs(?!&)"'
);

$urlout = array(
  'document-\\1-edit-\\2.html',
  'document-\\1-cat-\\2.html',
  'document-\\1.html',
  'documents.html'
);

?>


htaccess
Code:
#Docs
RewriteRule ^document-([0-9]*)-edit-([0-9]*).html modules.php?name=Docs&do=show_doc&id=$1&edit_doc=$2 [L]
RewriteRule ^document-([0-9]*)-cat-([0-9]*).html modules.php?name=Docs&do=show_doc&id=$1&cat=$2 [L]
RewriteRule ^document-([0-9]*).html modules.php?name=Docs&do=show_doc&id=$1 [L]
RewriteRule ^documents.html modules.php?name=Docs [L]
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Thu Jul 22, 2010 9:36 am Reply with quote

Hey, thank you sir!
 
View user's profile Send private message Visit poster's website
Guardian
Site Admin
Site Admin



Joined: Jul 18, 2005
Posts: 397

PostPosted: Fri Jul 23, 2010 4:38 am Reply with quote

Many thanks Spastic, I will probably add these to my site as I use the Docs module to show screen shots and installation instructions for various modules.
 
View user's profile Send private message
spasticdonkey
Newbie
Newbie



Joined: Sep 05, 2007
Posts: 78

PostPosted: Fri Jul 23, 2010 10:16 am Reply with quote

cool Smile

while not shortlink related here's a some other Nuke Docs stuff..

nukeDH file
includes/nukeSEO/dh/dhDocs.php
Code:
<?php
/************************************************************************/
/* nukeSEO
/* http://www.nukeSEO.com
/* Copyright (c) 2009 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 dhDocs extends dhclass {
   function dhDocs () {
      global $prefix;
      $this->content_id        = 'id';
      $this->content_table     = $prefix.'_docs';
      $this->contentTitleArray = array('title', 'subtitle');
      $this->contentDescArray  = array('text');
      $this->contentKeysArray  = array('title', 'subtitle','text');
      $this->cat_id            = 'cat';
      $this->cat_table         = $prefix.'_nuke_docs_categories';
      $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 $id;
      return $id;
   }
   function setContentID() {
      global $id, $dhID;
      $id = $dhID;
   }
   function getCatID() {
      global $cat;
      return $cat;
   }
   function setCatID() {
      global $cat, $dhCat;
      $cat = $dhCat;
   }
}
?>


nukeFEED
includes/nukeSEO/content/Docs.php
Code:
<?php
/************************************************************************/
/* nukeFEED
/* http://www.nukeSEO.com
/* Copyright 2007 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.       */
/************************************************************************/

if (stristr(htmlentities($_SERVER['PHP_SELF']), 'Docs.php')) {
    Header('Location: ../../../index.php');
    die();
}

class seoDocs extends seocontentclass
{
   function seoDocs ()
  {
      global $prefix;
      $this->name                  = 'Docs';
      $this->sql_col_id            = 'id';
      $this->sql_col_title         = 'title';
      $this->sql_col_desc          = 'text';
      $this->sql_col_time          = 'date';
      $this->sql_col_catid         = 'cat';
      $this->sql_col_author        = 'subtitle';
      $this->sql_table_with_prefix = $prefix.'_docs';
      $this->sql_where_cols        = array
                                   (
                                      'title',
                                      'subtitle',
                                      'text'
                                   );
    $this->activeWhere           = '';
      $this->orderArray            = array
                                   (
                                      'recent' => 'recent',
                                      'popular' => 'popular'
                                   );
      $this->orderSQLArray         = array
                                   (
                                      'recent' => 'id DESC',
                                      'popular' => 'counter DESC'
                                   );
      $this->levelArray            = array
                                   (
                                      'category' => 'category'
                                   );
      $this->levelSQLArray         = array(
                                      'category' => 'cat',
                                   );
  }
   function getLink($id, $cat)
  {
      return getNukeURL().'modules.php?name=Docs&do=show_doc&id='.$id;
  }
}
?>


nukeSEO Sitemap
modules/Sitemap/content/Docs.php

Code:
<?php
#########################################################################
# nukeSEO Copyright (c) 2005 Kevin Guske              http://nukeSEO.com
# Meta Tag function developed by Jens Hauge           http://visayas.dk
# Sitemap object approach from mSearch by David Karn  http://webdever.net
# Submit Sitemap from phpSitemapNG by Tobias Kluge    http://enarion.net
# Results originally developed by Curve2 Design       http://curve2.com
#########################################################################
# 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.
#########################################################################

if(!defined('ADMIN_FILE') and !defined('MODULE_FILE')) { header("Location: ../../../index.php");  die(); }

class seoDocs extends searchmodule {
   function seoDocs (){
      global $prefix;
      $this->name                  = 'Docs';
      $this->module                = 'Docs';
      $this->sql_col_time          = 'date';
      $this->sql_col_title         = 'title';
      $this->sql_col_id            = 'id';
      $this->sql_col_desc          = 'text';
      $this->sql_col_author        = 'subtitle';
      $this->sql_table_with_prefix = $prefix.'_docs';
      $this->sql_where_cols        = array('title',
                     'subtitle',
                     'text');
   }
   
      function formatGoogleResult($result){
      global $url;
      return $this->formatGoogleURL($url['scheme'].'://'.$url['host'].$url['path'].'?name=Docs&amp;do=show_doc&amp;id='.$result['rid']);
   }
      function formatSitemapResult($result){
      if (!trim($result['title'])){
         $result['title'] = 'View Result';
      }
      return '<a href="modules.php?name=Docs&amp;do=show_doc&amp;id='.$result['rid'].'" title="'.chopwords(strip_tags($result['desc']),192).'">'.$result['title'].'</a>';
   }
      
      }
?>
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Sat Jul 24, 2010 10:32 am Reply with quote

Thanks!
 
View user's profile Send private message Visit poster's website
Guardian
Site Admin
Site Admin



Joined: Jul 18, 2005
Posts: 397

PostPosted: Sat Jul 24, 2010 10:39 am Reply with quote

Above and beyond, thanks a lot!
 
View user's profile Send private message
spasticdonkey
Newbie
Newbie



Joined: Sep 05, 2007
Posts: 78

PostPosted: Sun Jul 25, 2010 2:16 pm Reply with quote

noticed a small error in the DH file above.. the cat_table should be _docs_categories NOT nuke_docs_categories ....

Code:
<?php
class dhDocs extends dhclass {
   function dhDocs () {
      global $prefix;
      $this->content_id        = 'id';
      $this->content_table     = $prefix.'_docs';
      $this->contentTitleArray = array('title', 'subtitle');
      $this->contentDescArray  = array('text');
      $this->contentKeysArray  = array('title', 'subtitle','text');
      $this->cat_id            = 'cat';
      $this->cat_table         = $prefix.'_docs_categories';
      $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 $id;
      return $id;
   }
   function setContentID() {
      global $id, $dhID;
      $id = $dhID;
   }
   function getCatID() {
      global $cat;
      return $cat;
   }
   function setCatID() {
      global $cat, $dhCat;
      $cat = $dhCat;
   }
}
?>
 
View user's profile Send private message
kguske
Community Giant



Joined: Dec 11, 2005
Posts: 32

PostPosted: Fri Aug 13, 2010 1:04 pm Reply with quote

Just noticed this. Cool....!

_________________
nukeSEO.com - PHPNuke SEO search engine optimization and other professional tools for PHP-Nuke 
View user's profile Send private message
spasticdonkey
Newbie
Newbie



Joined: Sep 05, 2007
Posts: 78

PostPosted: Tue Aug 17, 2010 10:10 pm Reply with quote

Cool

one last pointer regarding this module, it has a bug sorting any more than 10 documents under a parent document.

function getRecursive
modules/Docs/index.php

Code:
  $csql = "SELECT id, cat, parent, title FROM ".$prefix."_docs WHERE parent='$id' AND cat='$parent_cat_id' ".$active." ORDER BY parent ASC";


it's selecting all documents where parent=$id, so all results will have the same parent. Then it's also stating to ORDER BY parent, when the parent for all results is the same. I changed to:

Code:
  $csql = "SELECT id, cat, parent, title FROM ".$prefix."_docs WHERE parent='$id' AND cat='$parent_cat_id' ".$active." ORDER BY id ASC";


which at least keeps them in the order they were created... no other way to sort them w/o modifying ...
 
View user's profile Send private message
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


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 4 Hours
 
Forums ©
linear-bunch
linear-bunch