Fork me on GitHub

Rapport de message :*
 

Re: News 1.4 et vrais modérateurs

Titre du sujet : Re: News 1.4 et vrais modérateurs
par xvitry sur 30/09/2005 10:41:17

Salut,

1- copier le fichier index.php en indexmodo.php
2- supprimer le code qui ne concerne pas les articles en attentes, ce qui devrait donner quelque chose comme ça
<?php
// $Id: index.php,v 1.25 2004/09/02 17:04:07 hthouzard Exp $
// ------------------------------------------------------------------------ //
// XOOPS - PHP Content Management System                                      //
// Copyright (c) 2000 XOOPS.org                                             //
// <http://www.xoops.org/>   ... nbsp;   //
// ------------------------------------------------------------------------ //
// 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_once '../../../include/cp_header.php';
include_once 
XOOPS_ROOT_PATH."/class/xoopstopic.php";
include_once 
XOOPS_ROOT_PATH."/class/xoopslists.php";
include_once 
XOOPS_ROOT_PATH."/modules/news/class/class.newsstory.php";
include_once 
XOOPS_ROOT_PATH."/modules/news/class/class.newstopic.php";
include_once 
XOOPS_ROOT_PATH."/modules/news/class/class.sfiles.php";
include_once 
XOOPS_ROOT_PATH.'/class/uploader.php';
include_once 
XOOPS_ROOT_PATH.'/class/pagenav.php';
include_once 
XOOPS_ROOT_PATH.'/modules/news/admin/functions.php';
include_once 
XOOPS_ROOT_PATH.'/modules/news/include/functions.php';
include_once 
XOOPS_ROOT_PATH."/class/tree.php";
$dateformat=getmoduleoption('dateformat');
$myts =& MyTextSanitizer::getInstance();
$topicscount=0;

/**
 * Show new submissions
 *
 * This list can be view in the module's admin when you click on the tab named "Post/Edit News"
 * Submissions are news that was submit by users but who are not approved, so you need to edit
 * them to approve them.
 * Actually you can see the the story's title, the topic, the posted date, the author and a
 * link to delete the story. If you click on the story's title, you will be able to edit the news.
 * The table contains ALL the new submissions.
 * The system's block called "Waiting Contents" is listing the number of those news.
 */
function newSubmissions()
{
    global 
$dateformat;
    
$storyarray NewsStory :: getAllSubmitted();
    if ( 
count$storyarray ) > )
    {
        
news_collapsableBar('newsub''topnewsubicon');
        echo 
"<img onclick='toggle('toptable'); toggleIcon('toptableicon');' id='topnewsubicon' name='topnewsubicon' src=" XOOPS_URL "/modules/news/images/close12.gif alt='' /></a>&nbsp;"._AM_NEWSUB."</h4>";
        echo 
"<div id='newsub'>";
        echo 
"<br />";
        echo 
"<div style='text-align: center;'><table width='100%' cellspacing='1' cellpadding='3' border='0' class='outer'><tr class='bg3'><td align='center'>" _AM_TITLE "</td><td align='center'>" _AM_TOPIC "</td><td align='center'>" _AM_POSTED "</td><td align='center'>" _AM_POSTER "</td><td align='center'>" _AM_ACTION "</td></tr>n";
        
$class='';
        foreach( 
$storyarray as $newstory )
        {
            
$class = ($class == 'even') ? 'odd' 'even';
            echo 
"<tr class='".$class."'><td align='left'>n";
            
$title $newstory->title();
            if (!isset(
$title) || ($title == "" )) {
                echo 
"<a href='".XOOPS_URL."/modules/news/admin/index.php?op=edit&amp;returnside=1&amp;storyid=" $newstory -> storyid() . "'>" _AD_NOSUBJECT "</a>n";
            } else {
                echo 
"&nbsp;<a href='".XOOPS_URL."/modules/news/submit.php?returnside=1&amp;op=edit&amp;storyid=" $newstory -> storyid() . "'>" $title "</a>n";
            }
            echo 
"</td><td>" $newstory->topic_title() . "</td><td align='center' class='nw'>" formatTimestamp($newstory->created(),$dateformat) . "</td><td align='center'><a href='" XOOPS_URL "/userinfo.php?uid=" $newstory->uid() . "'>" $newstory->uname() . "</a></td><td align='right'><a href='".XOOPS_URL."/modules/news/admin/index.php?op=delete&amp;storyid=" $newstory->storyid() . "'>" _AM_DELETE "</a></td></tr>n";
        }
        echo 
"</table></div>";
        echo 
"<br /></div><br />";
    }
}




// **********************************************************************************************************************************************
// **** Main
// **********************************************************************************************************************************************
$op 'default';
if(isset(
$_POST['op'])) {
 
$op=$_POST['op'];
} else {
    if(isset(
$_GET['op'])) {
        
$op=$_GET['op'];
    }
}


switch (
$op)
{
    
    case 
"delete":
           
$storyid=0;
           if(isset(
$_GET['storyid'])) {
            
$storyid=intval($_GET['storyid']);
           } else {
               if(isset(
$_POST['storyid'])) {
                   
$storyid=intval($_POST['storyid']);
               }
           }

        if (!empty(
$_POST['ok'])) {
            if (empty(
$storyid)) {
                
redirect_header'index.php?op=newarticle'2_AM_EMPTYNODELETE );
                exit();
            }
            
$story = new NewsStory($storyid);
            
$story->delete();
            
$sfiles = new sFiles();
            
$filesarr=Array();
            
$filesarr=$sfiles->getAllbyStory($storyid);
            if(
count($filesarr)>0) {
                foreach (
$filesarr as $onefile) {
                    
$onefile->delete();
                }
            }
            
xoops_comment_delete($xoopsModule->getVar('mid'),$storyid);
            
xoops_notification_deletebyitem($xoopsModule->getVar('mid'), 'story'$storyid);
            
updateCache();
            
redirect_header'index.php?op=newarticle'1_AM_DBUPDATED );
            exit();
        } else {
            
$story = new NewsStory($storyid);
            
xoops_cp_header();
            echo 
"<h4>" _AM_CONFIG "</h4>";
            
xoops_confirm(array('op' => 'delete''storyid' => $storyid'ok' => 1), 'index.php'_AM_RUSUREDEL .'<br />' $story->title());
        }
        break;

 
    case 
"edit":
        include_once 
XOOPS_ROOT_PATH.'/modules/news/submit.php';
        break;


    case 
"default":
    default:
        
xoops_cp_header();
        
adminmenu(-1);
        if(!
TableExists($xoopsDB->prefix('stories_votedata')) || !TableExists($xoopsDB->prefix('stories_files')) )
        {
            echo 
"<div align='center'>"._AM_NEWS_PLEASE_UPGRADE."</div><br/><br />";
        }

        
//echo "<h4>" . _AM_CONFIG . "</h4>";
        //echo"<table width='100%' border='0' cellspacing='1' class='outer'><tr><td class="odd">";
        //echo " - <b><a href='index.php?op=topicsmanager'>" . _AM_TOPICSMNGR . "</a></b>";
        //echo "<br /><br />n";
        //echo " - <b><a href='index.php?op=newarticle'>" . _AM_PEARTICLES . "</a></b>n";
        //echo "<br /><br />n";
        //echo " - <b><a href='groupperms.php'>" . _AM_GROUPPERM . "</a></b>n";
        //echo "<br /><br />n";
        //echo " - <b><a href='" . XOOPS_URL . '/modules/system/admin.php?fct=preferences&amp;op=showmod&amp;mod=' . $xoopsModule -> getVar( 'mid' ) . "'>" . _AM_GENERALCONF . "</a></b>";
        //echo "<br /><br />n";
        //echo " - <b><a href='index.php?op=prune'>" . _AM_NEWS_PRUNENEWS . "</a></b>n";
        //echo "<br /><br />n";
        //echo " - <b><a href='index.php?op=export'>" . _AM_NEWS_EXPORT_NEWS . "</a></b>n";
        //echo "<br /><br />n";
        //echo " - <b><a href='index.php?op=configurenewsletter'>" . _AM_NEWS_NEWSLETTER . "</a></b>n";
        //echo "<br /><br />n";
        //echo " - <b><a href='index.php?op=stats'>" . _AM_NEWS_STATS . "</a></b>n";
        //echo"</td></tr></table>";
        
break;
}

xoops_cp_footer();
?>


3- pour le bloc, je suppose que c'est le bloc dans le fichier blocks/news_moderate.php
remplacer les index.php par indexmodo.php

PS: je n'ai rien testé, donc ce n'est qu'une théorie mais je ne sais pas si ça marche...
Par ailleurs le code d'Hervé étant particulièrement bien documenté et structuré, il est relativement facile de s'y retrouver et de comprendre chacune des options...

PS 2 : en fin de code, j'ai mis le menu en commentaire car je ne sais pas trop s'il faut effacer ou pas cette partie.

Bref, c'est un point de départ....

SVP, ne me jetez pas de cailloux pour tentative de massacre de modules, de toute façon je n'y connaît pas grand chose...

A+
Propulsé avec XOOPS | Graphisme adapté par Tatane, Grosdunord, Montuy337513

68 Personne(s) en ligne (46 Personne(s) connectée(s) sur Forum) | Utilisateur(s): 0 | Invité(s): 68 | Plus ...