71
xgarb
Re: x_movie module installation help
  • 2008/2/27 11:29

  • xgarb

  • Not too shy to talk

  • Posts: 154

  • Since: 2003/3/30


this is the line to go in htaccess to override php.ini. Apache only and is sometimes disabled..

php_value upload_max_filesize 16M

16M is the mb limit you want.



72
xgarb
Re: weblog (problem adding group permissions)
  • 2008/2/26 11:18

  • xgarb

  • Not too shy to talk

  • Posts: 154

  • Since: 2003/3/30


same here.. updated to PHP5 weblog stopped working.

I think it's something to do with the group permissions. The error on posting is 'Sorry, Only permitted users can post weBLog entries...'

Also the change group permissions in the module admin isn't working so I'm guessing something to do with permissions.

I couldn't see 'reads' in the reserved list, not sure a column name would matter anyway.
Reserved Lists:
http://blog.fullvalence.com/2008/01/04/upgrading-to-php5-part-1-new-reserved-keywords/
http://devzone.zend.com/manual/reserved.html

Would be good to get this going as it still seems the best blog module for xoops, the alternatives seem to be bolting other blog software onto XOOPS which IMO is inviting problems.

Maybe this code has something wrong (from admin/privmanager.php)
function addGroup($post) {
    if (isset(
$post['gid'])) {
        
$group_handler =& xoops_getmodulehandler('priv');
        foreach (
$post['gid'] as $gid) {
            
$group =& $group_handler->create();
            
$group->setVar('priv_gid'$gid);
            
$group_handler->insert($group);
        }
    }
    
redirect_header('privmanager.php'2_AM_WEBLOG_DBUPDATED);
}


and or this (from post.php)
$priv =& xoops_getmodulehandler('priv');
if (
$currentuid==|| (!$isAdmin && ($xoopsModuleConfig['adminonly'] || !$priv->hasPrivilege($currentUser)))) {
    
redirect_header(sprintf('%s/modules/%s/index.php'XOOPS_URL$xoopsModule->dirname()),
                    
5_BL_ANON_CANNOT_POST_SORRY);
    exit();
}


or maybe the class below? Bit beyond me!
class WeblogPrivHandler extends XoopsObjectHandler {

    function &
create() {
        return new 
WeblogPriv();
    }
    
    function &
get($id) {
        
$id intval($id);
        if (
$id ) {
            
$sql sprintf('SELECT p.priv_id, p.priv_gid, g.name FROM %s as p, %s as g WHERE p.priv_gid=%d AND p.priv_gid=g.groupid',
                           
$this->db->prefix(WEBLOG_DB_PREFIX_PRIV),
                           
$this->db->prefix(WEBLOG_DB_PREFIX_GROUPS),
                           
$id);
            if (
$result $this->db->query($sql)) {
                if (
$this->db->getRowsNum($result)==1) {
                    
$entry $this->create();
                    
$entry->assignVars($this->db->fetchArray($result));
                    return 
$entry;
                }
            }
        }
        return 
false;
    }

    function 
insert(&$entry) {
        if (
get_class($entry) != 'weblogpriv') {  // must be lowercase only
            
return false;
        }
        if (!
$entry->isDirty()) {
            return 
true;
        }
        if (!
$entry->cleanVars()) {
            return 
false;
        }

        foreach (
$entry->cleanVars as $k => $v) {
            ${
$k} = $v;
        }

        
$count $this->getCount(new Criteria('priv_id'$priv_id));
        if (
$priv_id && $count 0) {
            
$sql sprintf('UPDATE %s SET priv_gid=%d WHERE priv_id=%d',
                           
$this->db->prefix(WEBLOG_DB_PREFIX_PRIV),
                           
$priv_gid,
                           
$priv_id);
        } else {
            
$sql sprintf('INSERT INTO %s (priv_gid) VALUES (%d)',
                           
$this->db->prefix(WEBLOG_DB_PREFIX_PRIV),
                           
$priv_gid);
        }
        
$result $this->db->queryF($sql) or die($this->db->error());
        if (!
$result) {  // must be queryF()
            
return false;
        }

        if (empty(
$priv_id)) {
            
$entry->setVar('priv_id'$this->db->getInsertId());
        }

        return 
true;
    }

    function 
delete(&$entry) {
        if (
get_class($entry) != 'weblogpriv') {
            return 
false;
        }

        
$sql sprintf('DELETE FROM %s WHERE priv_id=%d LIMIT 1',
                       
$this->db->prefix(WEBLOG_DB_PREFIX_PRIV), $entry->getVar('priv_id'));
        if (!
$result $this->db->queryF($sql)) {  // must be queryF()
            
return false;
        }
        return 
true;
    }

    function 
getCount($criteria=null) {
        
$sql sprintf('SELECT count(*) as count FROM %s'$this->db->prefix(WEBLOG_DB_PREFIX_PRIV));
        if (isset(
$criteria) && is_subclass_of($criteria'criteriaelement')) {
            
$sql .= sprintf(' %s'$criteria->renderWhere());
        }
        if (!
$result $this->db->query($sql)) {
            return 
0;
        }
        
$count $this->db->fetchArray($result);
        return 
$count['count'];
    }

    function &
getObjects($criteria=null$id_as_key=false) {
        
$ret = array();
        
$limit $start 0;

        
$sql sprintf('SELECT p.priv_id, p.priv_gid, g.name FROM %s as p, %s as g',
                       
$this->db->prefix(WEBLOG_DB_PREFIX_PRIV),
                       
$this->db->prefix(WEBLOG_DB_PREFIX_GROUPS));
        if (isset(
$criteria) && is_subclass_of($criteria'criteriaelement')) {
            
$sql .= sprintf(' %s %s'$criteria->renderWhere(), 'AND p.priv_gid=g.groupid');
            
//$groupby = trim(str_replace('GROUP BY', "", $criteria->getGroupby()));
            //$sql .= ($groupby=='')?'':sprintf(' %s', $criteria->getGroupby());
            
$sort = ($criteria->getSort()!='') ? $criteria->getSort() : 'priv_id';
            
$sql .= sprintf(' ORDER BY %s %s'$sort$criteria->getOrder());
            
$limit $criteria->getLimit();
            
$start $criteria->getStart();
        } else {
            
$sql .= sprintf(' %s''WHERE p.priv_gid=g.groupid');
        }
        if (!
$result $this->db->query($sql$limit$start)) {
            return 
$ret;
        }
        while (
$myrow $this->db->fetchArray($result)) {
            
$entry $this->create();
            
$entry->assignVars($myrow);
            if (
$id_as_key) {
                
$ret[$myrow['priv_id']] =& $entry;
            } else {
                
$ret[] =& $entry;
            }
            unset(
$entry);
        }
        return 
$ret;
    }

    function 
hasPrivilege($user) {
        
$gids =& $user->getGroups();
        
$criteria =& new criteriaCompo();
        foreach(
$gids as $gid) {
            
$criteria->add(new criteria('priv_gid'$gid), 'OR');
        }
        
$result =& $this->getObjects($criteria);
        if (
count($result)>0) {
            return 
true;
        } else {
            return 
false;
        }
    }
}


Thanks for any help..



73
xgarb
Re: Classifieds 1.1 RC1 Security Release
  • 2008/2/24 17:53

  • xgarb

  • Not too shy to talk

  • Posts: 154

  • Since: 2003/3/30


Thanks for keeping this module updated.



74
xgarb
Re: Can an Administrator?????
  • 2008/2/1 13:48

  • xgarb

  • Not too shy to talk

  • Posts: 154

  • Since: 2003/3/30


In theory they can see everything as it's all stored somewhere on the server but whether they can bother to sift through is another matter.

They won't know your password to be able to change it back btw.



75
xgarb
Re: Image Manager improvements - file uploads
  • 2008/2/1 12:18

  • xgarb

  • Not too shy to talk

  • Posts: 154

  • Since: 2003/3/30


OK, I've had a little look around and it's pretty much as I remember from last time I looked at this..

The three methods of uploading are..

Old fashioned HTML forms
Java applets
Active-X controls

Ideally this system should resize the images BEFORE they're uploaded to the server as many users don't really understand image file sizes and just want to copy images straight off their digital camera.

If users are happy to install a Java applet this is a fair solution...http://upload.thinfile.com/docs/resize.php The user drags or browses for their image and the applet resizes it to the chosen sizes and uploads to the server. I found the compression is a little heavy and contacting the company is a bit hit and miss - even trying to pay!

There are a few other Java based uploaders but I haven't found one that creates multiple sizes before upload.

There are a few active-x solutions (oftem seen on photo-printing sites) but being IE only I'm not currently looking at them.

The third solution is to upload the image the old fashioned way through an HTML form and use PHP to resize the image to the required sizes on the server. This method could be used as a back up.

I also looked at Flash solutions but it looks like Flash doesn't allow access to the filesystem on a user's PC.

Anyone have any input? Would love to hear it.



76
xgarb
Re: Yogurt Social Network 2.9 BETA
  • 2008/2/1 10:56

  • xgarb

  • Not too shy to talk

  • Posts: 154

  • Since: 2003/3/30


Can I check something about the license for this..

"No Derivative Works. You may not alter, transform, or build upon this work."

So I guess this means I can't take your code, add something and release it as another module.

Can I take your code and create my own module but not release it? Can I take parts of your code to make mini-modules for my site?

Thanks,
xgarb



77
xgarb
Re: Image Manager improvements - preview concepts
  • 2008/1/31 16:58

  • xgarb

  • Not too shy to talk

  • Posts: 154

  • Since: 2003/3/30


Might have been some misunderstanding with my first post above. Wasn't asking someone to do this just who I should ask about doing it. Anyway I've started work on replacing the Image Manager in my own site and thought I'd share my work in the hope some other xoopers can help with some advice and comments.

The aim is to build a drop in replacement for the image manager. I'm building it using PHP5 to use some of the new functions.

Concept is pretty similar to the existing manager but with the addition of

1)Users own images screen so they can manage their own images away from the general site images.
2)Upload options that resize images as they are uploaded in a set number of preconfigured sizes.

To help explain how this will work in practice I've created some concept screenshots. These are purely concept at the moment to help work out how I'm going to implement this.

A user can see their own images on the 'My Images' tab.
User Images Thumbnail Display
Resized Image

Clicking an empty image area will bring up the upload screen (not got this done yet)
Clicking any of the images in the thumbnail display opens the image detail window as below..
User Images Detail
Resized Image

From here the user would click on the appropriate button to insert the image in their post (as the current image manager does). They can also rename the image or remove it from their area.

Alternatively the user can use the Site Images area to upload and access images that are available to anyone on the site...
Site Images Thumbnail Window
Resized Image

Clicking the thumbnail then leads to the screen to add the image to the post
Site Images Detail
Resized Image

The options for delete and rename do not appear on this screen.

The above images are Fireworks PNG so if you want to download and play feel free.

I'm researching image uploaders at the moment.. I've used a Java based one on another site that does a fair job but will be looking at others. It would be good to offer the user a choice of methods

First question I have is ... what's the best way to store the user's images? In directory and prefix each filename with the user id? Or store a reference in the database for each filename for who it 'belongs' to. Or is it better to create a directory for each user and use PHP to read the files from their directory? Can web servers had thousands of directories in one directory?

Will post tomorrow with more on the image upload part.



78
xgarb
Re: Private Message often overlooked
  • 2008/1/28 11:41

  • xgarb

  • Not too shy to talk

  • Posts: 154

  • Since: 2003/3/30


or send them a mail?...

https://xoops.org/modules/newbb/viewtopic.php?topic_id=17034&

code is out of date on the link above. This should really be in the core as well IMO.



79
xgarb
Re: mainfile.php chmod error
  • 2008/1/24 10:44

  • xgarb

  • Not too shy to talk

  • Posts: 154

  • Since: 2003/3/30


sticking this in a file in your htdocs should fix it..

<?php 
chmod
("mainfile.php"0444
?>


I found after an upgrade by my host that this was the only way to do it. FTP clients would fail.



80
xgarb
Re: XOOPS 2.3 Profiles Module - Requirements Gathering
  • 2008/1/20 17:47

  • xgarb

  • Not too shy to talk

  • Posts: 154

  • Since: 2003/3/30


Going on a bit of a tangent.. I agree that basic profile should be as minimal as possible but should be part of a bigger user account section that has things like a media manager (uploading and management of images, video and sounds), a preferences manager (theme chooser, notification type etc), communication manager, buddy manager etc this all should be core items IMO as then this will always exist for other modules to access. I realise that this is a bit outside the current scope for this thread but thought I'd mention it.

I can't decide if the extensible bit should be part of the core or should be module based to give site owners freedom to choose simple or complicated 'page I created' systems. Some might just want to have profiles as a list of a member's information others might want each member to have MySpace type pages.

Anyway thanks for reading




TopTop
« 1 ... 5 6 7 (8) 9 10 11 ... 14 »



Login

Who's Online

160 user(s) are online (87 user(s) are browsing Support Forums)


Members: 0


Guests: 160


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