1
Neobless
Re: You must READ this.
  • 2004/5/23 1:37

  • Neobless

  • Just popping in

  • Posts: 11

  • Since: 2004/1/22


dengage:

I really do not think you know how to use wfsection correctly. 400+ stories in one section? I am testing out the new version of wfsection and its amazing what this module can do. it does everything that every other content module does in one.

JMass:

wfsections is replacing the sections module as a core module.



2
Neobless
Re: XFSections : How can i stop admins from accessing certain parts?
  • 2004/5/13 20:25

  • Neobless

  • Just popping in

  • Posts: 11

  • Since: 2004/1/22


XF-Sections is a fork of WF-Sections. A beta of WF-Section v2 is out with everything that XF-Sections has and much more. You can give different admin access levels to different parts of WF-Section now.




3
Neobless
Re: The new coming Wfsections is no Myth
  • 2004/4/9 0:44

  • Neobless

  • Just popping in

  • Posts: 11

  • Since: 2004/1/22


If it is as good as you say it is? Then I will wait

Any chance of a hint to the new features then?



4
Neobless
Re: The new coming Wfsections is no Myth
  • 2004/4/8 20:59

  • Neobless

  • Just popping in

  • Posts: 11

  • Since: 2004/1/22


I'm sorry, but I will believe it when I see it, Catzwolf has promised this module wuld be released last year and that to me is far to long.

You say it has many new features? Like what exactly?



5
Neobless
Re: Hack for multi upload atavars
  • 2004/1/22 23:29

  • Neobless

  • Just popping in

  • Posts: 11

  • Since: 2004/1/22


Geezz!!

Download it!!!



6
Neobless
Hack for multi upload atavars
  • 2004/1/22 17:08

  • Neobless

  • Just popping in

  • Posts: 11

  • Since: 2004/1/22


I have hacked the XOOPS core to allow multi uploads with avatars, hope this helps other.

1, Create a folder called cache in uploads and CHMOD 0777.

2, Edit the following file modules/system/admin/avatars/main.php

At line 52 replace the whole case 'list' with this code:

if ( $op == 'list' )
    {
        
xoops_cp_header();
        echo 
'<h4 style="text-align:left">' _MD_AVATARMAN '</h4>';
        
$avt_handler = &xoops_gethandler'avatar' );
        
$savatar_count $avt_handler->getCount( new Criteria'avatar_type''S' ) );
        
$cavatar_count $avt_handler->getCount( new Criteria'avatar_type''C' ) );
        echo 
'<ul><li>' _MD_SYSAVATARS ' (' sprintf_NUMIMAGES'<b>' $savatar_count '</b>' ) . ') [<a href="admin.php?fct=avatars&op=listavt&type=S">' _LIST '</a>]</li><li>' _MD_CSTAVATARS ' (' sprintf_NUMIMAGES'<b>' $cavatar_count '</b>' ) . ') [<a href="admin.php?fct=avatars&op=listavt&type=C">' _LIST '</a>]</li></ul>';

        include_once 
XOOPS_ROOT_PATH '/class/xoopsformloader.php';
        include_once 
XOOPS_ROOT_PATH "/modules/wfsection/class/wfslists.php";
        
$iform = new XoopsThemeForm_MD_ADDAVT'avatar_form''admin.php' );
        
$iform->setExtra'enctype="multipart/form-data"' );
        
$graph_array = &XoopsLists::getImgListAsArrayXOOPS_ROOT_PATH "/uploads/cache" );
        
WfsLists::getarrayXOOPS_ROOT_PATH "/uploads/cache" );
        echo 
$htmlarray;
        
$atvarslisting = array();

        
$smallimage_select = new XoopsFormSelect'''atvarslisting'''10true );
        
$smallimage_select->addOptionArray$graph_array );
        
$smallimage_tray = new XoopsFormElementTray"Upload Batch Avatars:"'&nbsp;' );
        
$smallimage_tray->addElement$smallimage_select );

        
$iform->addElement$smallimage_tray );
        
$iform->addElement( new XoopsFormText_IMGWEIGHT'avatar_weight'34) );
        
$iform->addElement( new XoopsFormRadioYN"Use Auto Weight?"'avatar_autoweight'0_YES_NO ) );
        
$iform->addElement( new XoopsFormRadioYN_IMGDISPLAY'avatar_display'1_YES_NO ) );
        
$iform->addElement( new XoopsFormHidden'op''batchaddfile' ) );
        
$iform->addElement( new XoopsFormHidden'fct''avatars' ) );
        
$iform->addElement( new XoopsFormButton'''avt_button'_SUBMIT'submit' ) );
        
$iform->display();

        
$form = new XoopsThemeForm_MD_ADDAVT'avatar_form''admin.php' );
        
$form->setExtra'enctype="multipart/form-data"' );
        
$form->addElement( new XoopsFormText_IMAGENAME'avatar_name'50255 ), true );
        
$form->addElement( new XoopsFormFile_IMAGEFILE'avatar_file'500000 ) );
        
$form->addElement( new XoopsFormText_IMGWEIGHT'avatar_weight'34) );
        
$form->addElement( new XoopsFormRadioYN_IMGDISPLAY'avatar_display'1_YES_NO ) );
        
$form->addElement( new XoopsFormHidden'op''addfile' ) );
        
$form->addElement( new XoopsFormHidden'fct''avatars' ) );
        
$form->addElement( new XoopsFormButton'''avt_button'_SUBMIT'submit' ) );
        
$form->display();
        
xoops_cp_footer();
        exit();
    }


and after case 'save' add add this:

if ( $op == 'batchaddfile' )
    {
        include_once 
XOOPS_ROOT_PATH '/class/uploader.php';

        global 
$xoopsConfigUser;

        function 
getmimetype$ext )
        {
            
$mimetypes mimetype();
            if ( isset( 
$mimetypes[$ext] ) )
            {
                return 
$mimetypes[$ext];
            } 
            else
            {
                return 
false;
            } 
        } 

        function 
mimetype()
        {
            return array( 
"gif" => "image/gif",
                
"ief" => "image/ief",
                
"jpeg" => "image/pjpeg",
                
"jpeg" => "image/jpeg",
                
"jpg" => "image/jpeg",
                
"jpe" => "image/jpeg",
                
"png" => "image/x-png",
                
"unknown" => "application/octet-stream" 
                
);
        } 

        
$allowedmimetypes = array( 'image/gif''image/jpeg''image/pjpeg''image/x-png''image/png' );
        
$sourcepath XOOPS_ROOT_PATH '/uploads/cache/';
        
$destpath XOOPS_ROOT_PATH '/uploads/';
        
$err = array();
        
$ucount count$HTTP_POST_VARS['atvarslisting'] );

        for ( 
$i 0$i $ucount$i++ )
        {
            
$sourcefile strtolowerbasename$HTTP_POST_VARS['atvarslisting'][$i] ) );

            if ( @!
file_exists$sourcepath $sourcefile ) )
            {
                
$err[] = "File " basename$sourcefile ) . " does not exist in path " $sourcepath "<br />";
                continue;
            } 
            
// file size check, XOOPS doesn't do this when uploading? maybe it should?
            
if ( is_file$sourcepath $sourcefile ) )
            {
                
$size filesize$sourcepath $sourcefile );
                if ( 
$size $xoopsConfigUser['avatar_maxsize'] )
                {
                    
$err[] = "File size for " basename$sourcefile ) . " exceeds the ".$xoopsConfigUser['avatar_maxsize']." bytes limit.<br />";
                    continue;
                } 
            } 
            
$mediaDimension getimagesize$sourcepath $sourcefile );
            if ( 
$mediaDimension[0] > $xoopsConfigUser['avatar_width'] || $mediaDimension[1] > $xoopsConfigUser['avatar_height'] )
            {
                
$err[] = "File height or/and width (".$mediaDimension[1]." x ".$mediaDimension[0].") for file: " basename$sourcefile ) . "  exceeds the " $xoopsConfigUser['avatar_width'] . " x " $xoopsConfigUser['avatar_height'] . " limit";
                continue;
            } 
            
// split filename
            
$filename explode'.'$sourcefile );
            
$basename $filename['0'];
            
$ext $filename['1'];
            
$filemimetype getmimetype$ext );
            if ( 
$filemimetype == false )
            {
                
$err[] = "Unknown filetype for file " $sourcefile "<br />File has not been copied into the database.<br />";
                continue;
            } 
            if ( 
count$allowedmimetypes ) > && !in_array$filemimetype$allowedmimetypes ) )
            {
                
$err[] = "Not allowed mimetype for file " $sourcefile "<br />File has not been copied into the database.<br />";
                continue;
            } 
            
$destfile uniqid'savt' ) . '.' $ext
            
// copy files over with new name and delete the old one
            
if ( !copy$sourcepath $sourcefile$destpath $destfile ) )
            {
                
$err[] = "Error copying " $sourcefile " to path" $destpath ". ";
            } 
            else
            {
                
touch$destpath $destfile );
                
chmod$destpath $destfile0644 );
                if (!
chmod$sourcepath0777 ))
                {
                    
$err[] = "Error changing write permission on path" $sourcepath ", please change to 0777";
                }
                
chmod$sourcepath $sourcefile0666 );
                if ( !
unlink$sourcepath $sourcefile ) )
                {
                    
$err[] = "Error deleting " $sourcefile " to path" $destpath " ";
                    
$deleteme $sourcepath $sourcefile "deleteme";
                    if ( @
rename$sourcepath $sourcefile$deleteme ) )
                    {
                        
touch$deleteme );
                        
chmod$deleteme0644 );
                    } 
                } 
            } 
            
$avt_handler = &xoops_gethandler'avatar' );
            
$avatar = &$avt_handler->create();
            
$avatar->setVar'avatar_file'$destfile );
            
$avatar->setVar'avatar_name'$basename );
            
$avatar->setVar'avatar_mimetype'$filemimetype );
            
$avatar_display = empty( $avatar_display ) ? 1;
            
$avatar->setVar'avatar_display'$avatar_display );
            if ( 
$avatar_autoweight == )
            {
                
$avatar->setVar'avatar_weight'$i );
            } 
            else
            {
                
$avatar->setVar'avatar_weight'$avatar_weight );
            } 
            
$avatar->setVar'avatar_type''S' );
            if ( !
$avt_handler->insert$avatar ) )
            {
                
$err[] = sprintf_FAILSAVEIMG$avatar->getVar'avatar_name' ) );
            } 
        } 
        if ( 
count$err ) > )
        {
            
xoops_cp_header();
            
xoops_error$err );
            
xoops_cp_footer();
            exit();
        } 
        
redirect_header'admin.php?fct=avatars'2_MD_AM_DBUPDATED );
    }


How it works, copy all your new atavars to the cache folder and select the atavars you wish to upload and click on submit.

You should now have multi atavars





TopTop



Login

Who's Online

136 user(s) are online (57 user(s) are browsing Support Forums)


Members: 0


Guests: 136


more...

Donat-O-Meter

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

Latest GitHub Commits