31
wcrwcr
Re: Soapbox:Fatal error: Using $this when not in object context in...
  • 2009/11/9 12:55

  • wcrwcr

  • Home away from home

  • Posts: 1114

  • Since: 2003/12/12


Hi all

just a very very little bump

Thanks



32
wcrwcr
Re: Soapbox:Fatal error: Using $this when not in object context in...
  • 2009/11/6 2:01

  • wcrwcr

  • Home away from home

  • Posts: 1114

  • Since: 2003/12/12


Thank you very much Trabis

That´s fix the fatal error

however i´m still facing problems. Now I can´t assign an article to a column (author)

Just in case, here follows the whole "admin/article.php" file without the nice fix you´ve provided:

<?php
/**
 * $Id: article.php v 1.5 25 April 2004 hsalazar Exp $
 * Module: Soapbox
 * Version: v 1.5
 * Release Date: 25 April 2004
 * Author: hsalazar
 * Licence: GNU
 */

// -- General Stuff -- //
include( "admin_header.php" );

$op '';

foreach ( 
$_POST as $k => $v )
{
    ${
$k} = $v;


foreach ( 
$_GET as $k => $v )
{
    ${
$k} = $v;


if ( isset( 
$_GET['op'] ) ) $op $_GET['op'];
if ( isset( 
$_POST['op'] ) ) $op $_POST['op'];


// -- Edit function -- //
function editarticle$articleID '' )
    {
    global 
$xoopsUser$xoopsUser$xoopsConfig$xoopsDB$modify$xoopsModuleConfig$xoopsModule$XOOPS_URL

    include_once 
XOOPS_ROOT_PATH '/class/xoopsformloader.php';

    
/**
     * Clear all variables before we start
     */
    
if(!isset($block)) { $block 1; }

    if(!isset(
$html)) { $html 1; } else { $html intval($html); }
    if(!isset(
$smiley)) { $smiley 1; } else { $smiley intval($smiley); }
    if(!isset(
$xcodes)) { $xcodes 1; } else { $xcodes intval($xcodes); }
    if(!isset(
$breaks)) { $breaks 1; } else { $breaks intval($breaks); }

    if(!isset(
$weight)) { $weight 1; }
    if(!isset(
$comments)) { $comments 1; }
    if(!isset(
$offline)) { $offline 0; }
    if(!isset(
$votes)) { $votes 0; }
    if(!isset(
$rating)) { $rating 0.00; }

    if(!isset(
$columnID)) { $columnID 1; }

    if(!isset(
$headline)) { $headline ""; }
    if(!isset(
$lead)) { $lead ""; }
    if(!isset(
$bodytext)) { $bodytext ""; }
    if(!isset(
$teaser)) { $teaser ""; }
    if(!isset(
$title)) { $title ""; }
    
$artimage "blank.png";

    
// If there is a parameter, and the id exists, retrieve data: we're editing an article
    
if ( $articleID )
        {
        
$result $xoopsDB -> query"SELECT columnID, headline, lead, bodytext, teaser, weight, html, smiley, xcodes, breaks, block, artimage, votes, rating, comments, offline FROM " $xoopsDB -> prefix"sbarticles" ) . " WHERE articleID = '$articleID'" );
        list( 
$columnID$headline$lead$bodytext$teaser$weight$html$smiley$xcodes$breaks$block$artimage$votes$rating$comments$offline ) = $xoopsDB -> fetchrow$result );

        if ( !
$xoopsDB -> getRowsNum$result ) )
            {
            
redirect_header"index.php"1_AM_SB_NOARTTOEDIT );
            exit();
            }
        
adminMenu(2_AM_SB_ARTS._AM_SB_EDITING.$headline."'");

        echo 
"<h3 style='color: #2F5376; '>" _AM_SB_ADMINARTMNGMT "</h5>";
        
$sform = new XoopsThemeForm_AM_SB_MODART ": $headline"op"xoops_getenv'PHP_SELF' ) );
        } 
    else 
// there's no parameter, so we're adding an article
        
{
        
$result01 $xoopsDB -> query"SELECT COUNT(*) FROM " $xoopsDB -> prefix"sbcolumns" ) . " " );
        list( 
$totalcolumns ) = $xoopsDB -> fetchRow$result01 );
        if ( 
$totalcolumns == )
            {
            
redirect_header"index.php"1_AM_SB_NEEDONECOLUMN );
            exit();
            }
        
adminMenu(2_AM_SB_ARTS._AM_SB_CREATINGART);

        echo 
"<h3 style='color: #2F5376; '>" _AM_SB_ADMINARTMNGMT "</h5>";
        
$sform = new XoopsThemeForm_AM_SB_NEWART"op"xoops_getenv'PHP_SELF' ) );
        } 

    
$sform -> setExtra'enctype="multipart/form-data"' );

// COLUMN
    /*
    * Get information for pulldown menu using XoopsTree.
    * First var is the database table
    * Second var is the unique field ID for the categories
    * Last one is not set as we do not have sub menus in WF-FAQ
    */
    
$mytree = new XoopsTree$xoopsDB->prefix"sbcolumns" ), "columnID" "0" );

    
ob_start();
    
$sform -> addElement( new XoopsFormHidden'columnID'$columnID ) );
    
$mytree -> makeMySelBox"name""name"$columnID );
    
$sform -> addElement( new XoopsFormLabel_AM_SB_COLNAMEob_get_contents() ) );
    
ob_end_clean();

// HEADLINE, LEAD, BODYTEXT
    // This part is common to edit/add
    
$sform -> addElement( new XoopsFormText_AM_SB_ARTHEADLINE'headline'5080$headline ), true );
    
$sform -> addElement( new XoopsFormTextArea_AM_SB_ARTLEAD'lead'$lead560 ) );

// TEASER
    
$sform -> addElement( new XoopsFormTextArea_AM_SB_ARTTEASER'teaser'$teaser560 ) );
    
$autoteaser_radio = new XoopsFormRadioYN_AM_SB_AUTOTEASER'autoteaser'0' ' _AM_SB_YES ''' ' _AM_SB_NO '' );
    
$sform -> addElement$autoteaser_radio );
    
$sform -> addElement( new XoopsFormText_AM_SB_AUTOTEASERAMOUNT'teaseramount'44100 ) );

// BODY
    
$sform -> addElement( new XoopsFormDhtmlTextArea_AM_SB_ARTBODY'bodytext'$bodytext1560 ) );

// IMAGE
    // The article CAN have its own image :)
    // First, if the article's image doesn't exist, set its value to the blank file
    
if (!file_exists(XOOPS_ROOT_PATH "/" $xoopsModuleConfig['sbuploaddir'] . "/" $artimage) || !$artimage)
        {
        
$artimage "blank.png";
        } 
    
// Code to create the image selector
    
$graph_array = & XoopsLists :: getImgListAsArrayXOOPS_ROOT_PATH "/" $xoopsModuleConfig['sbuploaddir'] );
    
$artimage_select = new XoopsFormSelect'''artimage'$artimage );
    
$artimage_select -> addOptionArray$graph_array );
    
$artimage_select -> setExtra"onchange='showImgSelected("image5", "artimage", "" . $xoopsModuleConfig['sbuploaddir'] . "", "", "" . XOOPS_URL . "")'" );
    
$artimage_tray = new XoopsFormElementTray_AM_SB_SELECT_IMG'&nbsp;' );
    
$artimage_tray -> addElement$artimage_select );
    
$artimage_tray -> addElement( new XoopsFormLabel''"<br /><br /><img src='" XOOPS_URL "/" $xoopsModuleConfig['sbuploaddir'] . "/" $artimage "' name='image5' id='image5' alt='' />" ) );
    
$sform -> addElement$artimage_tray );

    
// Code to call the file browser to select an image to upload
    
$sform -> addElement( new XoopsFormFile_AM_SB_UPLOADIMAGE'cimage'$xoopsModuleConfig['maxfilesize'] ), false );

// COMMENTS
    // Code to allow comments
    
$addcomments_radio = new XoopsFormRadioYN_AM_SB_ALLOWCOMMENTS'comments'$comments' ' _AM_SB_YES ''' ' _AM_SB_NO '' );
    
$sform -> addElement$addcomments_radio );

// OFFLINE
    // Code to take article offline, for maintenance purposes
    
$offline_radio = new XoopsFormRadioYN(_AM_SB_SWITCHOFFLINE'offline'$offline' '._AM_SB_YES.''' '._AM_SB_NO.'');
    
$sform -> addElement($offline_radio);

// ARTICLE IN BLOCK
    // Code to put article in block
    
$block_radio = new XoopsFormRadioYN_AM_SB_BLOCK'block'$block ' ' _AM_SB_YES ''' ' _AM_SB_NO '' );
    
$sform -> addElement$block_radio );

// VARIOUS OPTIONS
    
$options_tray = new XoopsFormElementTray(_AM_SB_OPTIONS,'<br />');

    
$html_checkbox = new XoopsFormCheckBox'''html'$html );
    
$html_checkbox -> addOption1_AM_SB_DOHTML );
    
$options_tray -> addElement$html_checkbox );

    
$smiley_checkbox = new XoopsFormCheckBox'''smiley'$smiley );
    
$smiley_checkbox -> addOption1_AM_SB_DOSMILEY );
    
$options_tray -> addElement$smiley_checkbox );

    
$xcodes_checkbox = new XoopsFormCheckBox'''xcodes'$xcodes );
    
$xcodes_checkbox -> addOption1_AM_SB_DOXCODE );
    
$options_tray -> addElement$xcodes_checkbox );

    
$breaks_checkbox = new XoopsFormCheckBox'''breaks'$breaks );
    
$breaks_checkbox -> addOption1_AM_SB_BREAKS );
    
$options_tray -> addElement$breaks_checkbox );

    
$sform -> addElement$options_tray );

    
$sform -> addElement( new XoopsFormHidden'articleID'$articleID ) );

    
$button_tray = new XoopsFormElementTray'''' );
    
$hidden = new XoopsFormHidden'op''addart' );
    
$button_tray -> addElement$hidden );

    if ( !
$articleID // there's no articleID? Then it's a new article
        
{
        
$butt_create = new XoopsFormButton''''_AM_SB_CREATE'submit' );
        
$butt_create->setExtra('onclick="this.form.elements.op.value='addart'"');
        
$button_tray->addElement$butt_create );

        
$butt_clear = new XoopsFormButton''''_AM_SB_CLEAR'reset' );
        
$button_tray->addElement$butt_clear );

        
$butt_cancel = new XoopsFormButton''''_AM_SB_CANCEL'button' );
        
$butt_cancel->setExtra('onclick="history.go(-1)"');
        
$button_tray->addElement$butt_cancel );
        } 
    else 
// else, we're editing an existing article
        
{
        
$butt_create = new XoopsFormButton''''_AM_SB_MODIFY'submit' );
        
$butt_create->setExtra('onclick="this.form.elements.op.value='addart'"');
        
$button_tray->addElement$butt_create );

        
$butt_cancel = new XoopsFormButton''''_AM_SB_CANCEL'button' );
        
$butt_cancel->setExtra('onclick="history.go(-1)"');
        
$button_tray->addElement$butt_cancel );
        }

    
$sform -> addElement$button_tray );
    
$sform -> display();
    unset( 
$hidden );
    } 


/* -- Available operations -- */
switch ( $op )
    {
    case 
"mod":
        
xoops_cp_header();
        
$articleID = isset( $_POST['articleID'] ) ? intval$_POST['articleID'] ) : intval$_GET['articleID'] );
        
editarticle($articleID);
        break;

    case 
"addart":
//        global $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $xoopsModuleConfig    ;

        
$articleID = (isset($_POST['articleID'])) ? intval($_POST['articleID']) : 0;
        
$columnID = (isset($_POST['columnID'])) ? intval($_POST['columnID']) : 0;
        
$block = (isset($_POST['block'])) ? intval($_POST['block']) : 1;
        
$offline = (isset($_POST['offline'])) ? intval($_POST['offline']) : 0;
        
$breaks = (isset($_POST['breaks'])) ? intval($_POST['breaks']) : 0;

        
$comments = isset( $comments ) ? intval$comments ) : 0;
        
$html = isset( $html ) ? intval$html ) : 0;
        
$smiley = isset( $smiley ) ? intval$smiley ) : 0;
        
$xcodes = isset( $xcodes ) ? intval$xcodes ) : 0;

        
$weight = (isset($_POST['weight'])) ? intval($_POST['weight']) : 1;
        
$artimage = ($_POST['artimage'] != 'blank.png' ) ? $myts -> addSlashes($_POST['artimage']) : '';
        
$headline $myts -> htmlSpecialChars($_POST['headline']);
        
$lead $myts -> addSlashes($_POST['lead']);
        
$bodytext $myts -> addSlashes($_POST['bodytext']);

        
$votes = (isset($_POST['votes'])) ? intval($_POST['votes']) : 0;
        
$rating = (isset($_POST['rating'])) ? intval($_POST['rating']) : 0.00;

        if ( 
$_POST['autoteaser'] )
            {
            
$charlength $_POST['teaseramount'];
            
$teasertemp $_POST['bodytext'];

            if ( !
XOOPS_USE_MULTIBYTES )
                {
                
$teasertemp strip_tags$teasertemp'' );
                
$teasertemp $myts -> addSlashessubstr$teasertemp0, ( $charlength -) ) ) . "...";
                } 
            
$teaser $teasertemp;
            } 
        else
            {
            
$teaser $myts -> addSlashes$_POST['teaser'] );
            } 

        
$date time();

// ARTICLE IMAGE
        // Define variables
        
$error 0;
        
$word null;
        
$uid $xoopsUser -> uid();
        
$submit 1;
        
$date time();

        if ( 
$HTTP_POST_FILES['cimage']['name'] != "" )
            {
            include_once 
XOOPS_ROOT_PATH '/class/uploader.php';

            if ( 
file_existsXOOPS_ROOT_PATH "/" $xoopsModuleConfig['sbuploaddir'] . "/" $HTTP_POST_FILES['cimage']['name'] ) )
                {
                
redirect_header"index.php"1_AM_SB_FILEEXISTS );
                } 
            
$allowed_mimetypes = array( 'image/gif''image/jpeg''image/pjpeg''image/png' );

            
uploading($allowed_mimetypes$HTTP_POST_FILES['cimage']['name'], "index.php"0$xoopsModuleConfig['sbuploaddir']);
        
            
$artimage $HTTP_POST_FILES['cimage']['name'];
            }
        elseif (
$_POST["artimage"] != "blank.png")
            {
            
$artimage $myts -> addSlashes$_POST["artimage"] );
            } 
        else
            {
            
$artimage '';
            } 

// Save to database
        
if ( !$articleID )
            {
            if ( 
$xoopsDB -> query"INSERT INTO " $xoopsDB -> prefix"sbarticles" ) . " (articleID, columnID, headline, lead, bodytext, teaser, weight, html, smiley, xcodes, breaks, block, artimage, votes, rating, comments, offline, datesub ) VALUES ('', '$columnID', '$headline', '$lead', '$bodytext', '$teaser', '$weight', '$html', '$smiley', '$xcodes', '$breaks', '$block', '$artimage', '$votes', '$rating', '$comments', '$offline', '$date' )" ) )
                {
                
$xoopsDB =& Database::getInstance(); 
                
$newid mysql_insert_id();
                
$result $xoopsDB -> query"SELECT columnID FROM " $xoopsDB -> prefix"sbarticles" ) . " WHERE articleID = '$newid'" );
                list(
$columnID) = $xoopsDB -> fetchrow($result);

                
$result $xoopsDB -> query"SELECT name, total FROM " $xoopsDB -> prefix"sbcolumns" ) . " WHERE colid = '$columnID'" );
                list( 
$name$total ) = $xoopsDB -> fetchrow$result );
                
$total++;

                
$tags = array();
                
$tags['ARTICLE_NAME'] = $headline;
                
$tags['ARTICLE_URL'] = XOOPS_URL '/modules/' $xoopsModule -> getVar'dirname' ) . '/index.php?art&lid=' $newid
                
$tags['COLUMN_NAME'] = $name;
                
$tags['COLUMN_URL'] = XOOPS_URL '/modules/' $xoopsModule -> getVar'dirname' ) . '/index.php?op=col&columnID=' $columnID;
                
$notification_handler = & xoops_gethandler'notification' );
                
$notification_handler -> triggerEvent'global'0'new_article'$tags );
                
$notification_handler -> triggerEvent'category'$columnID'new_article'$tags );

                if ( 
$xoopsDB -> queryF"UPDATE " $xoopsDB -> prefix"sbcolumns" ) . " SET total = '$total' WHERE columnID = '$columnID'" ) )

                
redirect_header"index.php"1_AM_SB_ARTCREATEDOK );
                } 
            else
                {
                
redirect_header"index.php"1_AM_SB_ARTNOTCREATED );
                }
            } 
        else  
// That is, $articleID exists, thus we're editing an article
            
{
            if ( 
$xoopsDB -> query"UPDATE " $xoopsDB -> prefix"sbarticles" ) . " SET columnID = '$columnID', headline = '$headline', lead = '$lead', bodytext = '$bodytext', teaser = '$teaser', weight = '$weight', html = '$html', smiley = '$smiley', xcodes = '$xcodes', breaks = '$breaks', block = '$block', artimage = '$artimage', votes = '$votes', rating = '$rating', comments = '$comments', offline = '$offline', datesub =  '$date' WHERE articleID = '$articleID'" ) )
                {
                
redirect_header"index.php"1_AM_SB_ARTMODIFIED );
                } 
            else
                {
                
redirect_header"index.php"1_AM_SB_ARTNOTUPDATED );
                }
            }
        exit();
        break;

    case 
"del":
        Global 
$xoopsUser$xoopsUser$xoopsConfig$xoopsDB;

        
$confirm = ( isset( $confirm ) ) ? 0;

        if ( 
$confirm )
            {
            
$xoopsDB->query"DELETE FROM " $xoopsDB->prefix"sbarticles" ) . " WHERE articleID = $articleID);
            
xoops_comment_delete($xoopsModule->getVar('mid'), $articleID);
            
redirect_header"index.php"1sprintf_AM_SB_ARTISDELETED$headline ) );
            exit();
            } 
        else
            {
            
$articleID = ( isset( $_POST['articleID'] ) ) ? intval($_POST['articleID']) : intval($articleID);
            
$result $xoopsDB -> query"SELECT articleID, headline FROM " $xoopsDB -> prefix"sbarticles" ) . " WHERE articleID = $articleID);
            list( 
$articleID$headline ) = $xoopsDB -> fetchrow$result );
            
xoops_cp_header();
            
xoops_confirm( array( 'op' => 'del''articleID' => $articleID'confirm' => 1'headline' => $headline ), 'article.php'_AM_SB_DELETETHISARTICLE "<br /><br>" $headline_AM_SB_DELETE );
            
xoops_cp_footer();
        } 
        exit();
        break;

    case 
"default":
    default:
        
xoops_cp_header();
        include_once 
XOOPS_ROOT_PATH "/class/xoopsformloader.php";
        global 
$xoopsUser$xoopsUser$xoopsConfig$xoopsDB$xoopsModuleConfig$xoopsModule;
        
$myts =& MyTextSanitizer::getInstance();
        
editarticle();
        
showArticles (0);
        break;

    } 
xoops_cp_footer();

?>



And here follows the "admin/column.php" file
<?php
/**
 * $Id: column.php v 1.5 25 April 2004 hsalazar Exp $
 * Module: Soapbox
 * Version: v 1.5
 * Release Date: 25 April 2004
 * Author: hsalazar
 * Licence: GNU
 */

// -- General Stuff -- //
include( "admin_header.php" );

$op '';

foreach ( 
$_POST as $k => $v )
{
    ${
$k} = $v;


foreach ( 
$_GET as $k => $v )
{
    ${
$k} = $v;


if ( isset( 
$_GET['op'] ) ) $op $_GET['op'];
if ( isset( 
$_POST['op'] ) ) $op $_POST['op'];

function 
editcol$columnID '' )
    {
    
$weight 1;
    
$name '';
    
$author '';
    
$description '';
    
$colimage 'blank.png';

    Global 
$xoopsUser$xoopsUser$xoopsConfig$xoopsDB$modify$xoopsModuleConfig$xoopsModule$_GET
    include_once 
XOOPS_ROOT_PATH '/class/xoopsformloader.php';

    
// If there is a parameter, and the id exists, retrieve data: we're editing a column
    
if ( $columnID )
        {
        
$result $xoopsDB -> query"SELECT columnID, author, name, description, total, weight, colimage, created FROM " $xoopsDB -> prefix"sbcolumns" ) . " WHERE columnID = '$columnID'" );
        list( 
$columnID$author$name$description$total$weight$colimage$created ) = $xoopsDB -> fetchrow$result );

        if ( 
$xoopsDB -> getRowsNum$result ) == )
            {
            
redirect_header"column.php"1_AM_SB_NOCOLTOEDIT );
            exit();
            } 
        
xoops_cp_header();
        
adminMenu(1_AM_SB_COLS._AM_SB_EDITING.$name."'");

        echo 
"<h3 style='color: #2F5376; '>" _AM_SB_ADMINCOLMNGMT "</h3>";
        
$sform = new XoopsThemeForm_AM_SB_MODCOL ": $name"op"xoops_getenv'PHP_SELF' ) );
        } 
    else
        {
        
xoops_cp_header();
        
adminMenu(1_AM_SB_COLS._AM_SB_CREATINGCOL);

        echo 
"<h3 style='color: #2F5376; '>" _AM_SB_ADMINCOLMNGMT "</h3>";
        
$sform = new XoopsThemeForm_AM_SB_NEWCOL"op"xoops_getenv'PHP_SELF' ) );
        } 

    
$sform -> setExtra'enctype="multipart/form-data"' );
    
$sform -> addElement( new XoopsFormText_AM_SB_COLNAME'name'5080stripslashes($name) ), true );

    
// Selector to get author

    
if (is_numeric($author)) 
        {
        
$authorinput '';
        }
    else 
        {
        
$authorinput $author;
        }

    
ob_start();
    
getuserFormintval($author) );
    
$sform -> addElement( new XoopsFormLabel_AM_SB_AUTHORob_get_contents() ) );
    
ob_end_clean();

    
$sform -> addElement( new XoopsFormTextArea_AM_SB_COLDESCRIPT'description'$description760 ) );
    
$sform -> addElement( new XoopsFormText_AM_SB_COLPOSIT'weight'44$weight ) );

    if ( !
$colimage $colimage "nopicture.png";

    
$graph_array = & XoopsLists :: getImgListAsArrayXOOPS_ROOT_PATH "/" $xoopsModuleConfig['sbuploaddir'] );
    
$colimage_select = new XoopsFormSelect'''colimage'$colimage );
    
$colimage_select -> addOptionArray$graph_array );
    
$colimage_select -> setExtra"onchange='showImgSelected("image3", "colimage", "" . $xoopsModuleConfig['sbuploaddir'] . "", "", "" . XOOPS_URL . "")'" );
    
$colimage_tray = new XoopsFormElementTray_AM_SB_COLIMAGE'&nbsp;' );
    
$colimage_tray -> addElement$colimage_select );
    
$colimage_tray -> addElement( new XoopsFormLabel''"<br /><br /><img src='" XOOPS_URL "/" $xoopsModuleConfig['sbuploaddir'] . "/" $colimage "' name='image3' id='image3' alt='' />" ) );
    
$sform -> addElement$colimage_tray );

    
// Code to call the file browser to select an image to upload
    
$sform -> addElement( new XoopsFormFile_AM_SB_COLIMAGEUPLOAD'cimage'$xoopsModuleConfig['maxfilesize'] ), false );

    
$sform -> addElement( new XoopsFormHidden'columnID'$columnID ) );

    
$button_tray = new XoopsFormElementTray'''' );
    
$hidden = new XoopsFormHidden'op''addcol' );
    
$button_tray -> addElement$hidden );

    
// No ID for column -- then it's new column, button says 'Create'
    
if ( !$columnID )
        {
        
$butt_create = new XoopsFormButton''''_AM_SB_CREATE'submit' );
        
$butt_create->setExtra('onclick="this.form.elements.op.value='addcol'"');
        
$button_tray->addElement$butt_create );

        
$butt_clear = new XoopsFormButton''''_AM_SB_CLEAR'reset' );
        
$button_tray->addElement$butt_clear );

        
$butt_cancel = new XoopsFormButton''''_AM_SB_CANCEL'button' );
        
$butt_cancel->setExtra('onclick="history.go(-1)"');
        
$button_tray->addElement$butt_cancel );
        } 
    else 
// button says 'Update'
        
{
        
$butt_create = new XoopsFormButton''''_AM_SB_MODIFY'submit' );
        
$butt_create->setExtra('onclick="this.form.elements.op.value='addcol'"');
        
$button_tray->addElement$butt_create );

        
$butt_cancel = new XoopsFormButton''''_AM_SB_CANCEL'button' );
        
$butt_cancel->setExtra('onclick="history.go(-1)"');
        
$button_tray->addElement$butt_cancel );
        } 

    
$sform -> addElement$button_tray );
    
$sform -> display();
    unset( 
$hidden );
    } 

switch ( 
$op )
{
    case 
"mod":
        
$columnID = isset( $_POST['columnID'] ) ? intval$_POST['columnID'] ) : intval$_GET['columnID'] );
        
editcol$columnID );
        break;

    case 
"addcol":

        Global 
$xoopsUser$xoopsUser$xoopsConfig$xoopsDB$modify$myts$columnID;

        if ( isset( 
$_POST['columnID'] ) ) $columnID $_POST['columnID'];

        if ( ( 
$_POST['weight'] ) && is_numeric$_POST['weight'] ) )
            {
            
$weight $myts -> addSlashes$_POST['weight'] );
            } 
        else
            {
            
$weight 1;
            } 

        
$name $myts -> htmlSpecialChars$_POST['name'] );
        
$description $myts -> addslashes$_POST['description'] );
        
$description $myts->xoopsCodeDecode($description$allowimage 1);

        if (
$_POST['author'] == '-1'
            {
            
$author $myts->makeTboxData4Save($_POST['authorinput']);
            }
        else 
            {
            
$author $myts->makeTboxData4Save($_POST['author']);
            }

        if ( 
$HTTP_POST_FILES['cimage']['name'] != "" )
            {
            if ( 
file_existsXOOPS_ROOT_PATH "/" $xoopsModuleConfig['sbuploaddir'] . "/" $HTTP_POST_FILES['cimage']['name'] ) )
                {
                
redirect_header"column.php"1_AM_SB_FILEEXISTS );
                } 
            
$allowed_mimetypes = array( 'image/gif''image/jpeg''image/pjpeg''image/png' );
            
uploading$allowed_mimetypes$HTTP_POST_FILES['cimage']['name'], "index.php"0$xoopsModuleConfig['sbuploaddir'] );
            
$colimage $HTTP_POST_FILES['cimage']['name'];
            }
        elseif ( 
$_POST["colimage"] != "blank.png" )
            {
            
$colimage $myts -> addSlashes$_POST["colimage"] );
            } 
        else
            {
            
$colimage '';
            } 

        
// Run the query and update the data
        
if ( !$_POST['columnID'] )
            {
            if ( 
$xoopsDB -> query"INSERT INTO " $xoopsDB -> prefix"sbcolumns" ) . " (columnID, name, author, description, weight, total, colimage) VALUES ('', '$name', '$author', '$description', '$weight', '0', '$colimage')" ) )
                {
                
redirect_header"permissions.php"1_AM_SB_COLCREATED );

                
$newid $xoopsDB -> getInsertId(); 
                
// Notify of new column
                
global $xoopsModule;
                
$tags = array();
                
$tags['COLUMN_NAME'] = $name;
                
$tags['COLUMN_URL'] = XOOPS_URL '/modules/' $xoopsModule -> getVar'dirname' ) . '/index.php?op=col&columnID=' $newid;
                
$notification_handler = & xoops_gethandler'notification' );
                
$notification_handler -> triggerEvent'global'0'new_column'$tags );
                } 
            else
                {
                
redirect_header"index.php"1_AM_SB_NOTUPDATED );
                } 
            } 
        else
            {
            if ( 
$xoopsDB -> queryF"UPDATE " $xoopsDB -> prefix"sbcolumns" ) . " SET name = '$name', author = '$author', description = '$description', weight = '$weight', colimage = '$colimage' WHERE columnID = '$columnID'" ) )
                {
                
redirect_header"index.php"1_AM_SB_COLMODIFIED );
                } 
            else
                {
                
redirect_header"index.php"1_AM_SB_NOTUPDATED );
                } 
            } 
        exit();
        break;

    case 
"del":

        global 
$xoopsUser$xoopsUser$xoopsConfig$xoopsDB;

        
$groups = ( $xoopsUser ) ? $xoopsUser -> getGroups() : XOOPS_GROUP_ANONYMOUS;
        
$module_id $xoopsModule -> getVar'mid' );
        
$gperm_handler = & xoops_gethandler'groupperm' );
        
        
$confirm = ( isset( $confirm ) ) ? 0;

        if ( 
$confirm )
            {
            
$xoopsDB -> query"DELETE FROM " $xoopsDB -> prefix"sbcolumns" ) . " WHERE columnID = '$columnID'" );
            
$xoopsDB -> query"DELETE FROM " $xoopsDB -> prefix"sbarticles" ) . " WHERE columnID = '$columnID'" );
            
xoops_groupperm_deletebymoditem ($module_id_AM_SB_COLPERMS$columnID);
            
redirect_header"index.php"1sprintf_AM_SB_COLISDELETED$name ) );
            exit();
            } 
        else
            {
            
$columnID = ( isset( $_POST['columnID'] ) ) ? $_POST['columnID'] : $columnID;
            
$result $xoopsDB -> query"SELECT columnID, name FROM " $xoopsDB -> prefix"sbcolumns" ) . " WHERE columnID = '$columnID'" );
            list( 
$colid$name ) = $xoopsDB -> fetchrow$result );
            
xoops_cp_header();
            
xoops_confirm( array( 'op' => 'del''columnID' => $columnID'confirm' => 1'name' => $name ), 'column.php'_AM_SB_DELETETHISCOL "<br /><br>" $name_AM_SB_DELETE );
            
xoops_cp_footer();
            } 
        exit();
        break;

    case 
"cancel":
        
redirect_header"index.php"1sprintf_AM_SB_BACK2IDX'' ) );
        exit();

    case 
"default":
    default:
        
editcol();
        
showColumns);
        break;

xoops_cp_footer();

?>


As I told you before "just in case, ok?
I know that a pretty old module and I don´t want to boring you with that

BTW > Do you ever used soapbox?

thanks



33
wcrwcr
Re: Soapbox:Fatal error: Using $this when not in object context in...
  • 2009/11/5 22:47

  • wcrwcr

  • Home away from home

  • Posts: 1114

  • Since: 2003/12/12


Hi

Doing a search i found:

if you use $this outside of a class.

Note that you were allowed to use $this outside of classes in PHP4, but PHP5 does not allow it.

but as i´m a black hole in PHP.....still need some elightment

Thanks



34
wcrwcr
Soapbox:Fatal error: Using $this when not in object context in...
  • 2009/11/5 12:45

  • wcrwcr

  • Home away from home

  • Posts: 1114

  • Since: 2003/12/12


Hi all

On an old site, using the old (but good) Soapbox.
Xoops 2016 running PHP Version 5.2.9

Trying to submit or edit an article i´m having this error:

Fatal error: Using $this when not in object context in /home/wwws/public_html/modules/soapbox/admin/article.php on line 303

Follow a chunk of that file:

// Save to database
        
if ( !$articleID )
            {
            if ( 
$xoopsDB -> query"INSERT INTO " $xoopsDB -> prefix"sbarticles" ) . " (articleID, columnID, headline, lead, bodytext, teaser, weight, html, smiley, xcodes, breaks, block, artimage, votes, rating, comments, offline, datesub ) VALUES ('', '$columnID', '$headline', '$lead', '$bodytext', '$teaser', '$weight', '$html', '$smiley', '$xcodes', '$breaks', '$block', '$artimage', '$votes', '$rating', '$comments', '$offline', '$date' )" ) )
                {
                
$this -> db = & Database :: getInstance();
                
$newid mysql_insert_id();
                
$result $xoopsDB -> query"SELECT columnID FROM " $xoopsDB -> prefix"sbarticles" ) . " WHERE articleID = '$newid'" );
                list(
$columnID) = $xoopsDB -> fetchrow($result);

                
$result $xoopsDB -> query"SELECT name, total FROM " $xoopsDB -> prefix"sbcolumns" ) . " WHERE colid = '$columnID'" );
                list( 
$name$total ) = $xoopsDB -> fetchrow$result );
                
$total++;

                
$tags = array();
                
$tags['ARTICLE_NAME'] = $headline;
                
$tags['ARTICLE_URL'] = XOOPS_URL '/modules/' $xoopsModule -> getVar'dirname' ) . '/index.php?art&amp;lid=' $newid
                
$tags['COLUMN_NAME'] = $name;
                
$tags['COLUMN_URL'] = XOOPS_URL '/modules/' $xoopsModule -> getVar'dirname' ) . '/index.php?op=col&columnID=' $columnID;
                
$notification_handler = & xoops_gethandler'notification' );
                
$notification_handler -> triggerEvent'global'0'new_article'$tags );
                
$notification_handler -> triggerEvent'category'$columnID'new_article'$tags );

                if ( 
$xoopsDB -> queryF"UPDATE " $xoopsDB -> prefix"sbcolumns" ) . " SET total = '$total' WHERE columnID = '$columnID'" ) )

                
redirect_header"index.php"1_AM_SB_ARTCREATEDOK );
                } 
            else
                {
                
redirect_header"index.php"1_AM_SB_ARTNOTCREATED );
                }
            } 
        else  
// That is, $articleID exists, thus we're editing an article
            
{
            if ( 
$xoopsDB -> query"UPDATE " $xoopsDB -> prefix"sbarticles" ) . " SET columnID = '$columnID', headline = '$headline', lead = '$lead', bodytext = '$bodytext', teaser = '$teaser', weight = '$weight', html = '$html', smiley = '$smiley', xcodes = '$xcodes', breaks = '$breaks', block = '$block', artimage = '$artimage', votes = '$votes', rating = '$rating', comments = '$comments', offline = '$offline', datesub =  '$date' WHERE articleID = '$articleID'" ) )
                {
                
redirect_header"index.php"1_AM_SB_ARTMODIFIED );
                } 
            else
                {
                
redirect_header"index.php"1_AM_SB_ARTNOTUPDATED );
                }
            }
        exit();
        break;


The line spotted in the error is:

$this -> db = & Database :: getInstance();


So I ask, any "quick" fix for that fatal error?

I know that Soapbox is pretty old but it has some very interesting features and the site in question has lots of good articles on It...

thank you all in advance



35
wcrwcr
Re: Xoops Brasil - Important and dangerous
  • 2009/10/22 14:16

  • wcrwcr

  • Home away from home

  • Posts: 1114

  • Since: 2003/12/12


Well it seems that the old story is coming back again.

That was the main reason for the weakness and absense of the brazilian community noticed in nowdays

But how could just one person destroy the hard work of thousands?

Who is that guy, and why he´s doing that?
What kind of freak is that? All this crap sounds like an old and moldy latin american dictatorial feeling.

It´s a VERY sad news.....thousands of posts, tutorials, modules and translations dropped in the garbage.........

At least what I ask is, please anyone who have access to all the translations, please be brave and make then available.

@someone - you can count on me

Damn




36
wcrwcr
Re: Magazine-X, the new xoops themes generation
  • 2009/10/8 14:21

  • wcrwcr

  • Home away from home

  • Posts: 1114

  • Since: 2003/12/12


Hi

Quote:
The important thing is that these themes show the capabilities of XOOPS - that XOOPS can look really hot!!!


I agree in 1578%

Waiting for some of the rede mexico´s hotmodules too.
The mexican bros do a really killer job in design.
I love It



37
wcrwcr
Magazine-X, the new xoops themes generation
  • 2009/10/8 13:38

  • wcrwcr

  • Home away from home

  • Posts: 1114

  • Since: 2003/12/12


hi all

this is not a request but, take a look here:

http://demo-xoops.redmexico.com.mx/modules/news/article.php?storyid=24

Damn hot theme don´t you think?
Is it commercial or free?

Any download link?

We need It



38
wcrwcr
Re: 2009 XOOPS Website Redesign
  • 2009/10/8 13:24

  • wcrwcr

  • Home away from home

  • Posts: 1114

  • Since: 2003/12/12


Hey Eduardo (BitC3R0)

THANK YOU so much.

What nice new theme

Nothing so fresh and web 2 oriented for xoops.

Any minimal chance to share that KILLER theme or other like that?

We need more and more themes like that, definetly.

Once more, congrats!



39
wcrwcr
Re: TAD Modules - translation
  • 2009/8/24 10:46

  • wcrwcr

  • Home away from home

  • Posts: 1114

  • Since: 2003/12/12


Great news!

Waiting for the others

Thanks



40
wcrwcr
Re: TinyContent like module and blocks "à la" xoops.org
  • 2009/6/9 22:18

  • wcrwcr

  • Home away from home

  • Posts: 1114

  • Since: 2003/12/12


Hi

You must try the Mytabs module.
please do a quick search here and you´ll find lots of info about It




TopTop
« 1 2 3 (4) 5 6 7 ... 86 »



Login

Who's Online

286 user(s) are online (191 user(s) are browsing Support Forums)


Members: 0


Guests: 286


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