1
Peekay
Peekay's Tab Hack for Content 0.5
  • 2006/12/18 18:19

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


This hack enables you to display articles as horizontal tabbed items in Content 0.5. It works for items created in the WYSIWG editor and PageWraps (not external URLs). E.g.

The Restaurant (main menu)
The Restaurant - Bar Price List (submenu)
The Restaurant - Catering (submenu)

will display as:

The Restaurant | Bar Price List | Catering

Resized Image

Please note:

* It only works with Content 0.5
* It only displays tabs for main menu items and one submenu level.
* It only works if items are marked 'visible'.
* It's only been tested in XOOPS 2.0.13.2.


There are just 2 files to replace: 'content/index.php' and 'content/templates/ct_index.html'. The code for each is included below (please make backups first).

The actual tab CSS is embedded in the 'ct_index.html' template. You can mess around with this to change the tab style if you want. I've tested it in IE and Firefox and it all seems to work, but don't blame me if it spoils your whole day! I also don't think my SQL is very efficient, so if anyone can improve on it please do!.

index.php

<?php
//  ------------------------------------------------------------------------ //
//                XOOPS - PHP Content Management System                      //
//                    Copyright (c) 2000 xoops.org                           //
//                       <https://xoops.org/>                             //
//  ------------------------------------------------------------------------ //
//  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, or        //
//  (at your option) any later version.                                      //
//                                                                           //
//  You may not change or alter any portion of this comment or credits       //
//  of supporting developers from this source code or any supporting         //
//  source code which is considered copyrighted (c) material of the          //
//  original comment or credit authors.                                      //
//                                                                           //
//  This program is distributed in the hope that it will be useful,          //
//  but WITHOUT ANY WARRANTY; without even the implied warranty of           //
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            //
//  GNU General Public License for more details.                             //
//                                                                           //
//  You should have received a copy of the GNU General Public License        //
//  along with this program; if not, write to the Free Software              //
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
// ------------------------------------------------------------------------- //
// Author: Tobias Liegl (AKA CHAPI)                                          //
// Site: http://www.chapi.de                                                 //
// Project: The XOOPS Project                                                //
// ------------------------------------------------------------------------- //

include "../../mainfile.php";

// ------------------------------------------------------------------------- //
// Peekays Tab Hack                                                          //
// ------------------------------------------------------------------------- //

if ( file_exists("language/".$xoopsConfig['language']."/modinfo.php") ) {
        include(
"language/".$xoopsConfig['language']."/modinfo.php");
} else {
        include(
"language/english/modinfo.php");
}

$xoopsOption['template_main'] = 'ct_index.html';

include_once 
XOOPS_ROOT_PATH.'/header.php';

// Create a new PHP var and set it to contain the result of the tab-maker function
$tabdata=tabMaker();

// Create a new Smarty variable (tabs) and assign it the contents of the PHP var
$xoopsTpl->assign('tabs'$tabdata);

// create the function
function tabMaker(){
// set XOOPS database as a global var
global $xoopsDB;
// get the current story id
$thisid = ($_REQUEST['id']);
// get the current story parent details and put the value into a var
$query1 $xoopsDB->query("SELECT parent_id FROM ".$xoopsDB->prefix('content')." WHERE storyid=$thisid");
while(
$myrow1 $xoopsDB->fetchArray($query1) )
{
$thisid_parent $myrow1['parent_id'];
}
// create a new array
$tabs=array();
// create a counter
$q=1;
// Query the DB and put story data into the array.
$query $xoopsDB->query("SELECT storyid, parent_id, blockid, submenu, title, visible FROM ".$xoopsDB->prefix('content')." WHERE storyid=$thisid OR parent_id=$thisid OR storyid=$thisid_parent OR parent_id= CASE WHEN $thisid_parent >0 THEN $thisid_parent ELSE $thisid END AND visible=1");
while(
$myrow $xoopsDB->fetchArray($query) )
{
$tabs[$q]['storyid'] = $myrow['storyid'];
$tabs[$q]['parent_id'] = $myrow['parent_id'];
$tabs[$q]['blockid'] = $myrow['blockid'];
$tabs[$q]['submenu'] = $myrow['submenu'];
$tabs[$q]['title'] = $myrow['title'];
$tabs[$q]['visible'] = $myrow['visible'];
$q++;
}
return 
$tabs;
}

// ------------------------------------------------------------------------- //
// END of Peekays Tab Hack                                                   //
// ------------------------------------------------------------------------- //



$id = isset($HTTP_GET_VARS['id']) ? intval($HTTP_GET_VARS['id']) : 0;

if (
$id != 0) {
  
$result $xoopsDB->queryF("SELECT storyid, title, text, visible, nohtml, nosmiley, nobreaks, nocomments, link, address FROM ".$xoopsDB->prefix(_MIC_CONTENT_PREFIX)." WHERE storyid=$id");
}
else {
$result $xoopsDB->queryF("SELECT storyid FROM ".$xoopsDB->prefix(_MIC_CONTENT_PREFIX)." WHERE homepage=1");
list(
$storyid) = $xoopsDB->fetchRow($result);
header("Location: $PHP_SELF?id=$storyid");
}
include_once 
XOOPS_ROOT_PATH.'/header.php';
list(
$storyid,$title,$text,$visible,$nohtml,$nosmiley,$nobreaks,$nocomments,$link,$address) = $xoopsDB->fetchRow($result);

      if (
$link == 1) {
                
// include external content

                
$includeContent XOOPS_ROOT_PATH."/modules/"._MIC_DIR_NAME."/content/".$address;
                if (
file_exists($includeContent)){
                  
$xoopsOption['template_main'] = 'ct_index.html';

                  
ob_start();
              include(
$includeContent);
              
$content ob_get_contents();
          
ob_end_clean();
                  
//$content = include($includeContent);

                  
$xoopsTpl->assign('title'$title);
                  
$xoopsTpl->assign('content'$content);
                  
$xoopsTpl->assign('nocomments'$nocomments);
                  
$xoopsTpl->assign('mail_link''mailto:?subject='.sprintf(_C_INTARTIGO,$xoopsConfig['sitename']).'&body='.sprintf(_C_INTARTFOUND$xoopsConfig['sitename']).':  '.XOOPS_URL.'/modules/content/index.php?id='.$id);
                  
$xoopsTpl->assign('lang_printerpage'_C_PRINTERFRIENDLY);
                  
$xoopsTpl->assign('lang_sendstory'_C_SENDSTORY);
                  
$xoopsTpl->assign('id'$id);
            }
                else{
                        
redirect_header("index.php",1,_C_FILENOTFOUND);
                }
          }
          else {
        
// tiny content
                
$xoopsOption['template_main'] = 'ct_index.html';

            if (
$nohtml == 1) { $html 0; } else { $html 1; }
                if (
$nosmiley == 1) { $smiley 0; } else { $smiley 1; }
                if (
$nobreaks == 1) { $breaks 0; } else { $breaks 1; }

                
$myts =& MyTextSanitizer::getInstance();
            
$text=$myts->displayTarea($text$html$smiley11$breaks);

                
$xoopsTpl->assign('title'$title);
                
$xoopsTpl->assign('content'$text);
              
$xoopsTpl->assign('nocomments'$nocomments);
        
$xoopsTpl->assign('mail_link''mailto:?subject='.sprintf(_C_INTARTIGO,$xoopsConfig['sitename']).'&body='.sprintf(_C_INTARTFOUND$xoopsConfig['sitename']).':  '.XOOPS_URL.'/modules/content/index.php?id='.$id);
                
$xoopsTpl->assign('lang_printerpage'_C_PRINTERFRIENDLY);
                
$xoopsTpl->assign('lang_sendstory'_C_SENDSTORY);
                
$xoopsTpl->assign('id'$id);
          }

include 
XOOPS_ROOT_PATH.'/include/comment_view.php';
include_once 
XOOPS_ROOT_PATH.'/footer.php';

?>


ct_index.html

<!-- Peekays Tab Hack Template -->

<
style type="text/css">
#tabmenu {
color#000000;
border-bottom2px solid #cccccc;
margin12px 0px 0px 0px;
padding0px;
z-index1;
padding-left10px
}
#tabmenu li {
displayinline;
overflowhidden;
list-
style-typenone;
}
#tabmenu a, a.active {
color#000000;
background#ffffff;
font-familyVerdanaArialsans-serif;
font-size11px;
font-weightnormal;
line-height2.0;
border2px solid #cccccc;
margin0;
text-decorationnone;
}
/* For IE */
#tabmenu a, a.active { padding: 4px 5px 4px 5px;}
/* and for other browsers */
html>body #tabmenu a, a.active { padding: 4px 5px 5px 5px;}
#tabmenu a.active {
background#ffffff;
/* Border bottom same colour as active page */
border-bottom3px solid #ffffff;
}
#tabmenu a:hover {
color#000000;
background#eeeeee;
}
#tabmenu a:visited {
color#000000;
}
#tabmenu a.active:hover {
backgroundtransparent;
color#000000;
}
#tabcontent {
font0.9em/1.3em verdanaarialsans-serif;
background#ffffff;
padding20px;
border2px solid #cccccc;
border-topnone;
z-index2;
}
#tabcontent a {
text-decorationnone;
}
#tabcontent a:hover {
backgroundtransparent;
}
</
style>

<!-- 
Start unordered list loop -->

<
ul id="tabmenu">
<{foreach 
item=tab from=$tabs}>

<
li><{if $tab.storyid == $id}><class="active" href="index.php?id=<{$tab.storyid}>"><{$tab.title}></a>
<{else}><{if 
$tab.storyid != $id}>
<
a href="index.php?id=<{$tab.storyid}>"><{$tab.title}></a><{/if}><{/if}></li>

<{/foreach}>
</
ul>

<!-- 
End item loop -->

<
div id="tabcontent">

     <{
$content}>

</
div>

<{if 
$xoops_isadmin == 1}>
<
div align="right"><a href="<{$xoops_url}>/modules/content/admin/index.php?op=submit&return=1&id=<{$id}>"><img

src
="<{$xoops_url}>/modules/content/images/add.gif" alt="" border="0"

align="absmiddle"></a>&nbsp;&nbsp;&nbsp;&nbsp;<a

href
="<{$xoops_url}>/modules/content/admin/index.php?op=edit&id=<{$id}>&return=1"><img

src
="<{$xoops_url}>/modules/content/images/edit.gif" alt="" border="0" align="absmiddle"></a></div>
         <{/if}>
     <
div class="printandemail">
                                        <
a href="print.php?id=<{$id}>" target="_new"><img

src
="<{$xoops_url}>/modules/content/images/print.gif" alt="" width="16" height="16" border="0"

align="absmiddle"></a>&nbsp;&nbsp;&nbsp;&nbsp;
                                        <
a href="<{$mail_link}>"><img

src
="<{$xoops_url}>/modules/content/images/email.gif" alt="" width="16" height="10" border="0"

align="absmiddle"></a></div>
         </
div>

<{if 
$nocomments == 0}>
<
br /><br />
<
div style="text-align: center; padding: 3px; margin: 3px;">
  <{
$commentsnav}>
  <{
$lang_notice}>
</
div>

<
div style="margin: 3px; padding: 3px;">
<!-- 
start comments loop -->
<{if 
$comment_mode == "flat"}>
  <{include 
file="db:system_comments_flat.html"}>
<{elseif 
$comment_mode == "thread"}>
  <{include 
file="db:system_comments_thread.html"}>
<{elseif 
$comment_mode == "nest"}>
  <{include 
file="db:system_comments_nest.html"}>
<{/if}>
<!-- 
end comments loop -->
</
div>
<{/if}>


Tip:

To have your Content module display 'Main menu' items in the XOOPS main menu:

1) Disable XOOPS own 'Main Menu' block.
2) Enable the Content module 'Site Menu' block.
3) Hide the Content module in the site menu by entering a '0' instead of a '1' in XOOPS module admin.
4) Arrange the menu items by selecting 'Order Site Menu Block' in Content admin.

Credits:

davinci27 - for the very nice Content module.
Kaotik - for a great beginners guide to using PHP and Smarty in Xoops.
A thread is for life. Not just for Christmas.

2
kaotik
Re: Peekays Tab Hack for Content 0.5
  • 2006/12/19 10:56

  • kaotik

  • Just can't stay away

  • Posts: 861

  • Since: 2004/2/19


Nice job!
I also use content on a couple of sites and this will come in handy!
www.kaotik.biz

3
Peekay
Re: Peekays Tab Hack for Content 0.5
  • 2007/1/26 12:01

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


Tabbed Blocks in Content 0.5 and 0.6

I have discovered that it is possible to use Content 0.5 or 0.6 to manage tabbed module blocks as well as articles. All credit to Preachur for some good detective work on this topic and Herve for the code concept. Details in this thread.

The following example is for a forum.

Resized Image

Please note:

* It's tested on XOOPS 2.0.13.2 only
* It works with CBB 1.16a.
* It will *probably* work with NewBB.


1) Install the hack (see above for 0.5, below for 0.6).
2) Copy the code below and save it in a plain text file as 'tab_forum.php'. Make sure there is no space after the closing PHP tag.

<?php

include 'mainfile.php';
include_once 
XOOPS_ROOT_PATH.'/class/template.php'; include_once(XOOPS_ROOT_PATH.'/modules/newbb/blocks/newbb_block.php'); $result b_newbb_show(explode('|','10|0|time|0')); $tpl = new XoopsTpl(); $tpl->assign('block'$result); $tpl->display('db:newbb_block.html');

?>

3) Click the 'Content' button in the XOOPS admin sidebar and choose 'Add Pagewrap'.
4) In the top section (Upload File) click the 'Browse' button and upload 'tab_forum.php'.
When the file has uploaded...
5) In the bottom section (Add Pagewrap) select your options, e.g. menu position, visible, sub-menu etc. then choose 'tab_forum.php' from the drop-down menu.
6) Press 'Submit'.

If you need this to work with another module, please see the above mentioned forum thread which has a link to Herve's original article. If you have a code snippet that works with this hack, perhaps you could post it here. Please be sure to state XOOPS and Module versions clearly.
A thread is for life. Not just for Christmas.

4
Peekay
Re: Peekays Tab Hack for Content 0.5
  • 2007/1/26 16:29

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


Tab Hack updated for Content 0.6

Content 0.6 added the facility to have custom page titles. To use the tab hack with 0.6 use the updated version of 'index.php' and 'ct_index.html' shown below.

index.php

<?php
//  ------------------------------------------------------------------------ //
//                XOOPS - PHP Content Management System                      //
//                    Copyright (c) 2000 xoops.org                           //
//                       <https://xoops.org/>                             //
//  ------------------------------------------------------------------------ //
//  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, or        //
//  (at your option) any later version.                                      //
//                                                                           //
//  You may not change or alter any portion of this comment or credits       //
//  of supporting developers from this source code or any supporting         //
//  source code which is considered copyrighted (c) material of the          //
//  original comment or credit authors.                                      //
//                                                                           //
//  This program is distributed in the hope that it will be useful,          //
//  but WITHOUT ANY WARRANTY; without even the implied warranty of           //
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            //
//  GNU General Public License for more details.                             //
//                                                                           //
//  You should have received a copy of the GNU General Public License        //
//  along with this program; if not, write to the Free Software              //
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
// ------------------------------------------------------------------------- //
// Author: Tobias Liegl (AKA CHAPI)                                          //
// Site: http://www.chapi.de                                                 //
// Project: The XOOPS Project                                                //
// ------------------------------------------------------------------------- //

include "../../mainfile.php";

// ------------------------------------------------------------------------- //
// Peekays Tab Hack (updated for Content 0.6)                                //
// ------------------------------------------------------------------------- //

if ( file_exists("language/".$xoopsConfig['language']."/modinfo.php") ) {
        include(
"language/".$xoopsConfig['language']."/modinfo.php");
} else {
        include(
"language/english/modinfo.php");
}

$xoopsOption['template_main'] = 'ct_index.html';

include_once 
XOOPS_ROOT_PATH.'/header.php';

// Create a new PHP var and set it to contain the result of the tab-maker function
$tabdata=tabMaker();

// Create a new Smarty variable (tabs) and assign it the contents of the PHP var
$xoopsTpl->assign('tabs'$tabdata);

// create the function
function tabMaker(){
// set XOOPS database as a global var
global $xoopsDB;
// get the current story id
$thisid = ($_REQUEST['id']);
// get the current story parent details and put the value into a var
$query1 $xoopsDB->query("SELECT parent_id FROM ".$xoopsDB->prefix('content')." WHERE storyid=$thisid");
while(
$myrow1 $xoopsDB->fetchArray($query1) )
{
$thisid_parent $myrow1['parent_id'];
}
// create a new array
$tabs=array();
// create a counter
$q=1;
// Query the DB and put story data into the array.
$query $xoopsDB->query("SELECT storyid, parent_id, blockid, submenu, title, visible FROM ".$xoopsDB->prefix('content')." WHERE storyid=$thisid OR parent_id=$thisid OR storyid=$thisid_parent OR parent_id= CASE WHEN $thisid_parent >0 THEN $thisid_parent ELSE $thisid END AND visible=1");
while(
$myrow $xoopsDB->fetchArray($query) )
{
$tabs[$q]['storyid'] = $myrow['storyid'];
$tabs[$q]['parent_id'] = $myrow['parent_id'];
$tabs[$q]['blockid'] = $myrow['blockid'];
$tabs[$q]['submenu'] = $myrow['submenu'];
$tabs[$q]['title'] = $myrow['title'];
$tabs[$q]['visible'] = $myrow['visible'];
$q++;
}
return 
$tabs;
}

// ------------------------------------------------------------------------- //
// END of Peekays Tab Hack                                                   //
// ------------------------------------------------------------------------- //



$id = isset($HTTP_GET_VARS['id']) ? intval($HTTP_GET_VARS['id']) : 0;

if (
$id != 0) {
  
$result $xoopsDB->queryF("SELECT storyid, title, ptitle, text, visible, nohtml, nosmiley, nobreaks, nocomments, link, address FROM ".$xoopsDB->prefix(_MIC_CONTENT_PREFIX)." WHERE storyid=$id");
}
else {
$result $xoopsDB->queryF("SELECT storyid FROM ".$xoopsDB->prefix(_MIC_CONTENT_PREFIX)." WHERE homepage=1");
list(
$storyid) = $xoopsDB->fetchRow($result);
header("Location: $PHP_SELF?id=$storyid");
}
include_once 
XOOPS_ROOT_PATH.'/header.php';
list(
$storyid,$title,$ptitle,$text,$visible,$nohtml,$nosmiley,$nobreaks,$nocomments,$link,$address) = $xoopsDB->fetchRow($result);

      if (
$link == 1) {
                
// include external content

                
$includeContent XOOPS_ROOT_PATH."/modules/"._MIC_DIR_NAME."/content/".$address;
                if (
file_exists($includeContent)){
                  
$xoopsOption['template_main'] = 'ct_index.html';

                  
ob_start();
              include(
$includeContent);
              
$content ob_get_contents();
          
ob_end_clean();
                  
//$content = include($includeContent);

                  
$xoopsTpl->assign('title'$title);
                  
$xoopsTpl->assign('xoops_pagetitle',$ptitle);
                  
$xoopsTpl->assign('content'$content);
                  
$xoopsTpl->assign('nocomments'$nocomments);
                  
$xoopsTpl->assign('mail_link''mailto:?subject='.sprintf(_C_INTARTIGO,$xoopsConfig['sitename']).'&body='.sprintf(_C_INTARTFOUND$xoopsConfig['sitename']).':  '.XOOPS_URL.'/modules/content/index.php?id='.$id);
                  
$xoopsTpl->assign('lang_printerpage'_C_PRINTERFRIENDLY);
                  
$xoopsTpl->assign('lang_sendstory'_C_SENDSTORY);
                  
$xoopsTpl->assign('id'$id);
            }
                else{
                        
redirect_header("index.php",1,_C_FILENOTFOUND);
                }
          }
          else {
        
// tiny content
                
$xoopsOption['template_main'] = 'ct_index.html';

            if (
$nohtml == 1) { $html 0; } else { $html 1; }
                if (
$nosmiley == 1) { $smiley 0; } else { $smiley 1; }
                if (
$nobreaks == 1) { $breaks 0; } else { $breaks 1; }

                
$myts =& MyTextSanitizer::getInstance();
            
$text=$myts->displayTarea($text$html$smiley11$breaks);

                
$xoopsTpl->assign('title'$title);
                
$xoopsTpl->assign('xoops_pagetitle',$ptitle);
                
$xoopsTpl->assign('content'$text);
              
$xoopsTpl->assign('nocomments'$nocomments);
        
$xoopsTpl->assign('mail_link''mailto:?subject='.sprintf(_C_INTARTIGO,$xoopsConfig['sitename']).'&body='.sprintf(_C_INTARTFOUND$xoopsConfig['sitename']).':  '.XOOPS_URL.'/modules/content/index.php?id='.$id);
                
$xoopsTpl->assign('lang_printerpage'_C_PRINTERFRIENDLY);
                
$xoopsTpl->assign('lang_sendstory'_C_SENDSTORY);
                
$xoopsTpl->assign('id'$id);
          }

include 
XOOPS_ROOT_PATH.'/include/comment_view.php';
include_once 
XOOPS_ROOT_PATH.'/footer.php';

?>


ct_index.html

<!-- Peekays Tab Hack Template -->

<
style type="text/css">
#tabmenu {
color#000000;
border-bottom2px solid #cccccc;
margin12px 0px 0px 0px;
padding0px;
z-index1;
padding-left10px
}
#tabmenu li {
displayinline;
overflowhidden;
list-
style-typenone;
}
#tabmenu a, a.active {
color#000000;
background#ffffff;
font-familyVerdanaArialsans-serif;
font-size11px;
font-weightnormal;
line-height2.0;
border2px solid #cccccc;
margin0;
text-decorationnone;
}
/* For IE */
#tabmenu a, a.active { padding: 4px 5px 4px 5px;}
/* and for other browsers */
html>body #tabmenu a, a.active { padding: 4px 5px 5px 5px;}
#tabmenu a.active {
background#ffffff;
/* Border bottom same colour as active page */
border-bottom3px solid #ffffff;
}
#tabmenu a:hover {
color#000000;
background#eeeeee;
}
#tabmenu a:visited {
color#000000;
}
#tabmenu a.active:hover {
backgroundtransparent;
color#000000;
}
#tabcontent {
font0.9em/1.3em verdanaarialsans-serif;
background#ffffff;
padding20px;
border2px solid #cccccc;
border-topnone;
z-index2;
}
#tabcontent a {
text-decorationnone;
}
#tabcontent a:hover {
backgroundtransparent;
}
</
style>

<!-- 
Start unordered list loop -->

<
ul id="tabmenu">
<{foreach 
item=tab from=$tabs}>

<
li><{if $tab.storyid == $id}><class="active" href="index.php?id=<{$tab.storyid}>"><{$tab.title}></a>
<{else}><{if 
$tab.storyid != $id}>
<
a href="index.php?id=<{$tab.storyid}>"><{$tab.title}></a><{/if}><{/if}></li>

<{/foreach}>
</
ul>

<!-- 
End item loop -->

<
div id="tabcontent">

     <{
$content}>

</
div>

<{if 
$xoops_isadmin == 1}>
<
div align="right"><a href="<{$xoops_url}>/modules/content/admin/index.php?op=submit&return=1&id=<{$id}>"><img

src
="<{$xoops_url}>/modules/content/images/add.gif" alt="" border="0"

align="absmiddle"></a>&nbsp;&nbsp;&nbsp;&nbsp;<a

href
="<{$xoops_url}>/modules/content/admin/index.php?op=edit&id=<{$id}>&return=1"><img

src
="<{$xoops_url}>/modules/content/images/edit.gif" alt="" border="0" align="absmiddle"></a></div>
         <{/if}>
     <
div class="printandemail">
                                        <
a href="print.php?id=<{$id}>" target="_new"><img

src
="<{$xoops_url}>/modules/content/images/print.gif" alt="" width="16" height="16" border="0"

align="absmiddle"></a>&nbsp;&nbsp;&nbsp;&nbsp;
                                        <
a href="<{$mail_link}>"><img

src
="<{$xoops_url}>/modules/content/images/email.gif" alt="" width="16" height="10" border="0"

align="absmiddle"></a></div>
         </
div>

<{if 
$nocomments == 0}>
<
br /><br />
<
div style="text-align: center; padding: 3px; margin: 3px;">
  <{
$commentsnav}>
  <{
$lang_notice}>
</
div>

<
div style="margin: 3px; padding: 3px;">
<!-- 
start comments loop -->
<{if 
$comment_mode == "flat"}>
  <{include 
file="db:system_comments_flat.html"}>
<{elseif 
$comment_mode == "thread"}>
  <{include 
file="db:system_comments_thread.html"}>
<{elseif 
$comment_mode == "nest"}>
  <{include 
file="db:system_comments_nest.html"}>
<{/if}>
<!-- 
end comments loop -->
</
div>
<{/if}>


It is worth noting that (AFAIK) the Content module does not have an upgrade script. If you were using the 0.5 version you will need to export/save articles, un-install the original module and re-build your items after installing 0.6.
A thread is for life. Not just for Christmas.

5
preachur
Re: Peekays Tab Hack for Content 0.5
  • 2007/1/26 22:38

  • preachur

  • Just can't stay away

  • Posts: 525

  • Since: 2006/2/4 4


Wow! That's a great hack! I was just using the straight ajax thing I found here:http://www.dynamicdrive.com/dynamicindex17/ajaxtabscontent/index.htm

I think there are many open-source ajax and java utilities we could implement through Content. (And other modules through the templates.)

I would like to work up some tutorials to put all of this information together for everyone.

Maybe eventually we should set up a collaborative mod dev project to implement many utilities into one module that would allow people to use them all on any page of their XOOPS site.

How about it, Peekay?

I've already found a content block slideshow and content block marquee just on that one site. The marquee is really simple and would allow any block to be scrolled anywhere. I'm sure there are more.
Magick can never be restrained, but when freely given is thrice regained!

6
Peekay
Re: Peekays Tab Hack for Content 0.5
  • 2007/1/27 21:15

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


Tabbed blocks - code correction

I left a 'mainfile' inclusion statement in the original code which you don't actually need.

If you have already installed the pagewrap, to update:

1) Click the 'content' button in XOOPS admin sidebar.
2) Select 'Add Pagewrap'.
3) In the middle section (delete file) select 'tab_forum.php' from the drop down menu and press the 'Delete' button.
4) Copy the code below and save it as 'tab_forum.php'
5) In the top section (Upload File) click the 'Browse' button and upload 'tab_forum.php'.
When the file has uploaded...
6) In the bottom section (Add Pagewrap) select your options, e.g. menu position, visible, sub-menu etc. then choose 'tab_forum.php' from the drop-down menu.
7) Press 'Submit'.

<?php

include_once XOOPS_ROOT_PATH.'/class/template.php'; include_once(XOOPS_ROOT_PATH.'/modules/newbb/blocks/newbb_block.php'); $result b_newbb_show(explode('|','10|0|time|0')); $tpl = new XoopsTpl(); $tpl->assign('block'$result); $tpl->display('db:newbb_block.html');

?>


Sorry about that.

@ preachur
The content 0.6 module is simple and works well. I agree with you in that it has potential as a 'front-end' to manage content other than articles.

I'm working on some pretty tabs. Watch this space!
A thread is for life. Not just for Christmas.

7
domineaux
Re: Peekays Tab Hack for Content 0.5
  • 2007/1/27 22:46

  • domineaux

  • Quite a regular

  • Posts: 389

  • Since: 2002/9/29


Peekay

Where do you get the Content lastest ver?

I'm going to try the Tabbed Content script with it.

Thanks

8
Peekay
Re: Peekays Tab Hack for Content 0.5
  • 2007/1/28 0:01

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


Hi domineaux.

This works with Content 0.5 or 0.6. You can get 0.6 (which has custom page titles) here in the repository

I believe there is a newer version of Content in development, but I haven't tried it.
A thread is for life. Not just for Christmas.

9
domineaux
Re: Peekays Tab Hack for Content 0.5
  • 2007/1/28 1:43

  • domineaux

  • Quite a regular

  • Posts: 389

  • Since: 2002/9/29


Quote:

Peekay wrote:
Hi domineaux.

This works with Content 0.5 or 0.6. You can get 0.6 (which has custom page titles) here in the repository

I believe there is a newer version of Content in development, but I haven't tried it.



I saw it in repository, but the date was so old as indicated there. I thought it couldn't be the correct version.

Thanks for the info

10
domineaux
Re: Peekays Tab Hack for Content 0.5
  • 2007/1/28 3:22

  • domineaux

  • Quite a regular

  • Posts: 389

  • Since: 2002/9/29


Peekay

I installed the Content .5 tonight, but looking through all the postings I need to allow a couple hours just to ferret through the postings. Sorting out the "this don't works" from the "this works" looks like it's going to be a royal pain in the south.

Have you thought to consolidate the information into one good posting? I'm sure I can work through it, but I just see hours of trial and error ahead. I'm sure I wouldn't be the only one that would appreciate your efforts...for sure.

Heck, my teachers' always had to explain the process twice to me.

Thanks

Login

Who's Online

90 user(s) are online (65 user(s) are browsing Support Forums)


Members: 0


Guests: 90


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits