1
noelmaster
section modules how to show new fileds?
  • 2004/11/3 15:58

  • noelmaster

  • Just popping in

  • Posts: 23

  • Since: 2004/10/28


Hi i modified a little the section module i added new textboxes on the admnin area and it worked now beside the title and the content add to the database new datas ..

the admin/index.php is ok i guess works fine ..my problem now is the index.php .

i give you the ode plz can u help me plz ...i needto show to the viewarticle the new datas

// $Id: index.php,v 1.10 2004/09/11 10:37:20 Onokazu Exp $
//  ------------------------------------------------------------------------ //
//                XOOPS - PHP Content Management System                      //
//                    Copyright (c) 2000 XOOPS.org                           //
//                                                    //
//  ------------------------------------------------------------------------ //
// Based on:                                     //
// myPHPNUKE Web Portal System - http://myphpnuke.com/                   //
// PHP-NUKE Web Portal System - http://phpnuke.org/                   //
// Thatware - http://thatware.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 //
//  ------------------------------------------------------------------------ //
include 'header.php';

function 
listsections()
{
    global 
$xoopsConfig$xoopsDB$xoopsUser$xoopsTheme$xoopsLogger$xoopsModule$xoopsTpl$xoopsUserIsAdmin;
    include 
XOOPS_ROOT_PATH.'/header.php';
    
$myts =& MyTextSanitizer::getInstance();
    
$result $xoopsDB->query("SELECT secid, secname, image FROM ".$xoopsDB->prefix("sections")." ORDER BY secname");
    echo 
"";
    
printf(_MD_WELCOMETOSEC,$xoopsConfig['sitename']);
    echo 
"";
    echo 
_MD_HEREUCANFIND.'';
    
$count 0;
    while ( list(
$secid$secname$image) = $xoopsDB->fetchRow($result) ) {
        
$secname $myts->makeTboxData4Show($secname);
        
$image $myts->makeTboxData4Show($image);
        if ( 
$count == ) {
            echo 
"";
            
$count 0;
        }
        echo 
"$secid'>$image' border='0' alt='$secname'>";
        
$count++;
        if ( 
$count == ) {
            echo 
"";
        }
        echo 
"";
    }
    echo 
"
";
    include 
'../../footer.php';
}

function 
listarticles($secid)
{
    global 
$xoopsConfig$xoopsUser$xoopsDB$xoopsTheme$xoopsLogger$xoopsModule$xoopsTpl$xoopsUserIsAdmin;
    include 
'../../header.php';
    
$myts =& MyTextSanitizer::getInstance();
    
$result $xoopsDB->query("SELECT secname, image FROM ".$xoopsDB->prefix("sections")." WHERE secid=$secid");
    list(
$secname$image) = $xoopsDB->fetchRow($result);
    
$secname $myts->makeTboxData4Show($secname);
    
$image $myts->makeTboxData4Show($image);
    
$result $xoopsDB->query("SELECT artid, secid, title, content, counter FROM ".$xoopsDB->prefix("seccont")." WHERE secid=$secid");
    echo 
"
$image' border='0'>";
    
printf(_MD_THISISSECTION,$secname);
    echo 
""._MD_THEFOLLOWING."";
    while ( list(
$artid$secid$title$content$counter) = $xoopsDB->fetchRow($result) ) {
        
$title $myts->makeTboxData4Show($title);
        
$content $myts->makeTareaData4Show($content);
        echo 
"  · $artid'>$title";
        
printf(" (read: %s times)",$counter);
        echo 
"$artid'>  .XOOPS_URL."/modules/progetti/images/print.gif' border='0' alt='' . _MD_PRINTERPAGE.' />";
    }
    echo 
""._MD_RETURN2INDEX." ]
"
;
    include 
'../../footer.php';
}

function 
viewarticle($artid,$page)
{
    global 
$xoopsConfig$xoopsUser$xoopsDB$xoopsTheme$xoopsLogger$xoopsModule$xoopsTpl$xoopsUserIsAdmin;
    include 
'../../header.php';
    
$myts =& MyTextSanitizer::getInstance();
    
$xoopsDB->queryF("UPDATE ".$xoopsDB->prefix("seccont")." SET counter=counter+1 WHERE artid=$artid");
    
$result $xoopsDB->query("SELECT artid, secid, title, content, informazioni, attuatore, partners, links, counter FROM ".$xoopsDB->prefix("seccont")." WHERE artid=$artid");
    list(
$artid$secid$title$content$informazioni$attuatore$partners$links$counter) = $xoopsDB->fetchRow($result);
    
$title $myts->makeTboxData4Show($title);
    
$content $myts->makeTareaData4Show($content);
    
$informazioni $myts->makeTboxData4Show($informazioni);
    
$attuatore $myts->makeTboxData4Show($attuatore);
    
$partners $myts->makeTboxData4Show($partners);
    
$links $myts->makeTboxData4Show($links);
    
$result2 $xoopsDB->query("SELECT secid, secname FROM ".$xoopsDB->prefix("sections")." WHERE secid=$secid");
    list(
$secid$secname) = $xoopsDB->fetchRow($result2);
    
$secname $myts->makeTboxData4Show($secname);
    
$words count(explode(" "$content,$links));
    
//echo "
";
    /* Rip the article into pages. Delimiter string is "[pagebreak]"  */
    $contentpages explode("[pagebreak]"$content$links);
    
$pageno count($contentpages);
    
/* Define the current page    */
    
if ( $page=="" || $page ) {
        
$page 1;
    }
    if ( 
$page $pageno ) {
          
$page $pageno;
    }
    
$arrayelement = (int)$page;
    
$arrayelement --;
    echo 
"$title";
    echo (
$contentpages[$arrayelement]);
    echo 
"$previous_page        $next_page";
    echo 
"
    

$secid'>".sprintf(_MD_BACK2SEC,$secname)." |
        "
._MD_RETURN2INDEX." | $artid'>]";
    include 
'../../footer.php';
}

function 
PrintSecPage($artid)
{
    global 
$xoopsConfig$xoopsUser$xoopsDB$xoopsTpl$xoopsUserIsAdmin;
    
$myts =& MyTextSanitizer::getInstance();
    
$result=$xoopsDB->query("SELECT title, content, links FROM ".$xoopsDB->prefix("seccont")." WHERE artid=$artid");
    list(
$title$content$informazioni$attuatore$partners$links) = $xoopsDB->fetchRow($result);
    
$title $myts->makeTboxData4Show($title);
    
$content $myts->makeTareaData4Show($content);
    echo 
"
        
        "</span><span style="color: #007700">.</span><span style="color: #0000BB">$xoopsConfig</span><span style="color: #007700">[</span><span style="color: #DD0000">'sitename'</span><span style="color: #007700">].</span><span style="color: #DD0000">"
        
        
        
        
        .XOOPS_URL."/images/logo.gif' border='0' alt='' />
        
$title
        "
.str_replace("[pagebreak]","",$content,$links)."";
        echo 
"";
        echo 
"";
        
printf(_MD_COMESFROM$xoopsConfig['sitename']);
        echo 
".XOOPS_URL."'>".XOOPS_URL."";
        echo 
_MD_URLFORTHIS."
        .XOOPS_URL."/modules/progetti/index.php?op=viewarticle&artid=$artid'>".XOOPS_URL."/modules/progetti/index.php?op=viewarticle&artid=$artid
        
        
        "
;
}

$op = isset($HTTP_GET_VARS['op']) ? trim($HTTP_GET_VARS['op']) : '';
$secid = isset($HTTP_GET_VARS['secid']) ? intval($HTTP_GET_VARS['secid']) : 0;
$page = isset($HTTP_GET_VARS['page']) ? intval($HTTP_GET_VARS['page']) : 0;
$links = isset($HTTP_GET_VARS['links']) ? intval($HTTP_GET_VARS['links']) : 0;
$artid = isset($HTTP_GET_VARS['artid']) ? intval($HTTP_GET_VARS['artid']) : 0;


switch ( 
$op ) {
case 
"viewarticle":
    
viewarticle($artid$page$links);
    break;
case 
"listarticles":
    
listarticles($secid);
    break;
case 
"printpage":
    
PrintSecPage($artid);
    break;
default:
    
listsections();
    break;
}
?>


thanks a lot for any help

2
jellyfishnz
Re:section modules how to show new fileds?
  • 2004/11/4 9:32

  • jellyfishnz

  • Just popping in

  • Posts: 6

  • Since: 2004/11/4


I wonder how I could incorporate a text box like yours into the News and Sections modules?

Thanks.

3
noelmaster
Re:section modules how to show new fileds?
  • 2004/11/4 10:23

  • noelmaster

  • Just popping in

  • Posts: 23

  • Since: 2004/10/28


ok first of allyou have to create new fields on the sections' table

then add new textboxes or textarea on the adminarea ... after that try it.. then go to the phpmyadmin se if the new fields are working ..

that's all .. the problem now ..how to show the new fields in the section/index.php ?

i tryed everything but is not working out ...

4
noelmaster
Re:section modules how to show new fileds?
  • 2004/11/4 22:48

  • noelmaster

  • Just popping in

  • Posts: 23

  • Since: 2004/10/28


lol i found out how .. now the section module is cooler lol

Login

Who's Online

462 user(s) are online (72 user(s) are browsing Support Forums)


Members: 0


Guests: 462


more...

Donat-O-Meter

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

Latest GitHub Commits