61
ralf57
Re: Which object/class handles directories creation/deletion?
  • 2004/9/5 14:27

  • ralf57

  • Quite a regular

  • Posts: 231

  • Since: 2003/2/3 1


Hi mith,
i need a little support.
I have this php function which delete non-empty folders:
<?php
/**
* Delete a file, or a folder and its contents
*
* @author      Aidan Lister <aidan@php.net>
* @version     1.0
* @param       string   $dirname    The directory to delete
* @return      bool     Returns true on success, false on failure
*/

//added by me start
//include 'mainfile.php';

global $xoopsUser;
$username  $xoopsUser->getVar('uname');
$dirname XOOPS_ROOT_PATH."/uploads/$username";
//added by me end

function rmdirr($dirname)
{
    
// Simple delete for a file
    
if (is_file($dirname)) {
        return 
unlink($dirname);
    }

    
// Loop through the folder
    
$dir dir($dirname);
    while (
false !== $entry $dir->read()) {
        
// Skip pointers
        
if ($entry == '.' || $entry == '..') {
            continue;
        }

        
// Deep delete directories      
        
if (is_dir("$dirname/$entry")) {
            
rmdirr("$dirname/$entry");
        } else {
            
unlink("$dirname/$entry");
        }
    }

    
// Clean up
    
$dir->close();
    return 
rmdir($dirname);
}

?>

I have to perform the function right after a user has been deleted(by the admin).
I have tried to include the file in \modules\system\admin\users\main.php
it doesn't work.
Can you help me further,please?

Updates...
I've found this piece of code that is dedicated to user's deletion:
case "delUser":
    
xoops_cp_header();
    
$member_handler =& xoops_gethandler('member');
    
$userdata =& $member_handler->getUser($uid);
    
xoops_confirm(array('fct' => 'users''op' => 'delUserConf''del_uid' => $userdata->getVar('uid')), 'admin.php'sprintf(_AM_AYSYWTDU,$userdata->getVar('uname')));
    
xoops_cp_footer();
    break;

How can i edit it o reach my goal?



62
ralf57
Re: Which object/class handles directories creation/deletion?
  • 2004/9/5 12:36

  • ralf57

  • Quite a regular

  • Posts: 231

  • Since: 2003/2/3 1


Thank you mith,
this is the code i was able to write:
if (is_dir(XOOPS_ROOT_PATH."/uploads/$username)) {
    echo 
'&nbsp;';
} else {
mkdir(XOOPS_ROOT_PATH."/uploads/$username"0755);
chmod(XOOPS_ROOT_PATH."/uploads/$username"0777);
}

It creates the folder only if the folder doesn't exists.
I have no errors from phpìs debug.
I'm in doubt if i have to also use the umask() function for the code to work properly in Unix systems.



63
ralf57
Which object/class handles directories creation/deletion?
  • 2004/9/5 8:42

  • ralf57

  • Quite a regular

  • Posts: 231

  • Since: 2003/2/3 1


Hi all,
i need to get this goal:
each time a new user gets the "active" status a new directory
named as the new user has to be automatically created inside
xoops_install/uploads/ folder.
And so the opposite:when a user is deleted,the relative folder
in xoops_install/uploads/ has to be deleted too.
I guess XOOPS has a built-in function to do this but wasn't able to find it.
Any help is appreciated.
ATB,ralf.



64
ralf57
Personal uploads directory
  • 2004/9/4 11:45

  • ralf57

  • Quite a regular

  • Posts: 231

  • Since: 2003/2/3 1


I was wondering if is it possible to have this feature added to XOOPS in a short time,as a hack for example.
I mean something like this:

xoops_install/uploads/username1
xoops_install/uploads/username3
xoops_install/uploads/username4
etc..

so each user has his own folder,with a preset disk quota,where he can uploads files and create/delete folders.
The personal folder should be created when the user becomes active without admin intervention.
The current image manager lacks of these possibilities and if a site has many users the uploads folder quickly becomes unusable.
I didn't find anything similar already done in the forum.
If i was wrong please point me in the right direction.
ATB,ralf.



65
ralf57
Re: FCKEditor Image Uploading Problems
  • 2004/8/17 0:00

  • ralf57

  • Quite a regular

  • Posts: 231

  • Since: 2003/2/3 1


Quote:
it hangs up when trying to upload images

Do you get any error?
Have you created the folder "your_site/uploads/images/"?
I can't reproduce this on my testserver but if you give me additonal infos i may be help you.



66
ralf57
Re: Need help hacking FCKeditor 1.6
  • 2004/7/24 12:59

  • ralf57

  • Quite a regular

  • Posts: 231

  • Since: 2003/2/3 1


No reply yet...
It sounds a bit strange that none is interested adding this cool feature to FCKEditor.
Hey,i'm doing all this work for the whole xoops' community not only for my needs



67
ralf57
Need help hacking FCKeditor 1.6
  • 2004/7/23 23:34

  • ralf57

  • Quite a regular

  • Posts: 231

  • Since: 2003/2/3 1


Hi all,
i'm integrating FCKeditor 1.6 into xoops.
In addition i wish to add a new dialog that allow opening
the full-size image in a separate popup by clicking on the resized image.
I've found a js function that can be used for this purpose.
Here's the triggering link:
<a href="javascript:popImage('http://SomeSite.com/SomeImage.gif','Some Title')">

The integration is almost complete,i miss only this popup feature.
If you're comfortable with javascript and/or FCKeditor,
please contact me or follow this thread.
ATB,ralf.

P.S1.:the original editor can be downloaded here

P.S2:i've also started a new thread on FCKeditor's support forum where i explain some details.Please read it here

P.S3:this hack will be publicly released togheter with a tutorial when finished



68
ralf57
Re: integrated FCKEditor with next XOOPS
  • 2004/7/23 9:38

  • ralf57

  • Quite a regular

  • Posts: 231

  • Since: 2003/2/3 1


Quote:
is there any possibilities to integrate FCKEditor (http://www.fckeditor.net/) with XOOPS


Hi adwin,
i'm integrating FCKEditor 1.6 (only IE 5.5> compatible)
I'm also trying to make a hack that will allow to open images in a new pop-up,but i'm having troubles since i'm not a coder.
Note that the editor itself is already integrated,i miss the popup feature.
Anyone available for a helping hand?
I plan to release this hack once finished.
ATB,ralf



69
ralf57
Re: Xhtml 1.0 validation pic only in validated pages???
  • 2004/7/9 17:00

  • ralf57

  • Quite a regular

  • Posts: 231

  • Since: 2003/2/3 1


You're right,
on-the-fly validation is not the right way!!!
I'll adopt the blocks' solution.
Nice xoopsing!



70
ralf57
Re: Xhtml 1.0 validation pic only in validated pages???
  • 2004/7/9 16:18

  • ralf57

  • Quite a regular

  • Posts: 231

  • Since: 2003/2/3 1


Quote:
Best I can think of is to put the w3c code in a block and set the block visible only in the modules, you know validate


Thank you Mith,
this is the solution i also had in mind...
but it should be more elegant to have the pics switching at
the bottom of the page instead of in a block




TopTop
« 1 ... 4 5 6 (7) 8 9 10 ... 13 »



Login

Who's Online

94 user(s) are online (60 user(s) are browsing Support Forums)


Members: 0


Guests: 94


more...

Donat-O-Meter

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

Latest GitHub Commits