311
noo-b
Re: Yogurt Social Network 2.9 BETA
  • 2008/1/2 12:31

  • noo-b

  • Just can't stay away

  • Posts: 456

  • Since: 2007/10/23


bump
I Love Xoops



312
noo-b
Re: Yogurt Social Network 2.9 BETA
  • 2007/12/31 5:34

  • noo-b

  • Just can't stay away

  • Posts: 456

  • Since: 2007/10/23


i'm still testing this beta module in local server with my limited programming knowledge trying to fix bugs

is there anyone know how to fix the bug in the list of visitor's who visit user profile..i have my own username in the list..how to fix that ?
I Love Xoops



313
noo-b
Re: Problem with Tag module and XoopsTube
  • 2007/12/31 3:40

  • noo-b

  • Just can't stay away

  • Posts: 456

  • Since: 2007/10/23


great...would be nice if the keywords are use as the tag...
and make it as a required field

most user are lazy to input to many fields...like in my site...i have the auto approve disable and most of the time user didn't enter a single keyword in the video submission..i have to enter the keyword by myself
I Love Xoops



314
noo-b
Re: New project for users profile/blog module
  • 2007/12/31 3:24

  • noo-b

  • Just can't stay away

  • Posts: 456

  • Since: 2007/10/23


Great...another user profile..i can see that you build the module based on smartprofile/yogurt....
i have use smarprofile and yogurt, and i find it not working in my site ...too many bugs..


for me personally i want a profile module that has feature like this
- add new fields easily
- comments in profile : during the process of sending a comment, a friend/user can choose for it to be public or private - public mean all user can see the comment and private only the user who send and owner of the profile can see the comment
- add friend - keep it simple (yogurt is too complex on this)
- list of visitors who visits the profile
- country with flag image (eg. Russia [flag])
- find related user using tags : user that comes from same country you can see example from friendster.com
- online status
- option to have friendly url sitename.com/username
- simple blog - commentable/have blog category/archives/recent post/tag
- report user to admin/block user from viewing profile
- easy templates for easy modification to design
- more advance stats example
Quote:

Comment 3 Intotal, 2 new/unread 1 public 2 private
Last active 6 mins ago, 11:07 am
Profile visits 13 today, 1266 this month, 4528 all time
PM received 12 today, 1025 this month, 2017 all time
etc


p/s : you can see what user want in the yogurt - feat request
https://sourceforge.net/tracker/?group_id=204109&atid=988291
I Love Xoops



315
noo-b
Re: xoopspolls - show total comment in block
  • 2007/12/27 6:18

  • noo-b

  • Just can't stay away

  • Posts: 456

  • Since: 2007/10/23


thank you very much banditx you're the man

it works perfectly

it would be nice if you also provide the same hack for umfrage module
I Love Xoops



316
noo-b
Re: xoopspolls - show total comment in block
  • 2007/12/27 5:43

  • noo-b

  • Just can't stay away

  • Posts: 456

  • Since: 2007/10/23


this is my edited class/xoopspoll.php..can u check ..did i put the function in the right place ?

<?php
// $Id: xoopspoll.php,v 1.9 2003/10/05 00:34:12 okazu Exp $
//  ------------------------------------------------------------------------ //
//                XOOPS - PHP Content Management System                      //
//                    Copyright (c) 2000 XOOPS.org                           //
//                       <https://xoops.org/>                             //
//  ------------------------------------------------------------------------ //
//  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 //
//  ------------------------------------------------------------------------ //
// Author: Kazumi Ono (AKA onokazu)                                          //
// URL: http://www.myweb.ne.jp/, https://xoops.org/, http://www.xoopscube.jp/ //
// Project: The XOOPS Project                                                //
// ------------------------------------------------------------------------- //
include_once XOOPS_ROOT_PATH."/class/xoopsobject.php";



class 
XoopsPoll extends XoopsObject
{
    var 
$db;

    
//constructor
    
function XoopsPoll($id=null)
    {
        
$this->db =& Database::getInstance();
        
$this->initVar("poll_id"XOBJ_DTYPE_INTnullfalse);
        
$this->initVar("question"XOBJ_DTYPE_TXTBOXnulltrue255);
        
$this->initVar("description"XOBJ_DTYPE_TXTBOXnullfalse255);
        
$this->initVar("user_id"XOBJ_DTYPE_INTnullfalse);
        
$this->initVar("start_time"XOBJ_DTYPE_INTnullfalse);
        
$this->initVar("end_time"XOBJ_DTYPE_INTnulltrue);
        
$this->initVar("votes"XOBJ_DTYPE_INT0false);
        
$this->initVar("voters"XOBJ_DTYPE_INT0false);
        
$this->initVar("display"XOBJ_DTYPE_INT1false);
        
$this->initVar("weight"XOBJ_DTYPE_INT0false);
        
$this->initVar("multiple"XOBJ_DTYPE_INT0false);
        
$this->initVar("mail_status"XOBJ_DTYPE_INT1false);
        if ( !empty(
$id) ) {
            if ( 
is_array($id) ) {
                
$this->assignVars($id);
            } else {
                
$this->load(intval($id));
            }
        }
    }




    
// public
    
function store()
    {
        if ( !
$this->cleanVars() ) {
            return 
false;
        }
        foreach ( 
$this->cleanVars as $k=>$v ) {
            $
$k $v;
        }
        
$start_time = empty($start_time) ? time() : $start_time;
        if ( 
$end_time <= $start_time ) {
            
$this->setErrors("End time must be set to future");
            return 
false;
        }
        if ( empty(
$poll_id) ) {
            
$poll_id $this->db->genId($this->db->prefix("xoopspoll_desc")."_poll_id_seq");
            
$sql "INSERT INTO ".$this->db->prefix("xoopspoll_desc")." (poll_id, question, description, user_id, start_time, end_time, votes, voters, display, weight, multiple, mail_status) VALUES ($poll_id, ".$this->db->quoteString($question).", ".$this->db->quoteString($description).", $user_id$start_time$end_time, 0, 0, $display$weight$multiple$mail_status)";
        } else {
            
$sql ="UPDATE ".$this->db->prefix("xoopspoll_desc")." SET question=".$this->db->quoteString($question).", description=".$this->db->quoteString($description).", start_time=$start_time, end_time=$end_time, display=$display, weight=$weight, multiple=$multiple, mail_status=$mail_status WHERE poll_id=$poll_id";
        }
        
//echo $sql;
        
if ( !$result $this->db->query($sql) ) {
            
$this->setErrors("Could not store data in the database.");
            return 
false;
        }
        if ( empty(
$poll_id) ) {
            return 
$this->db->getInsertId();
        }
        return 
$poll_id;
    }

    
// private
    
function load($id)
    {
        
$sql "SELECT * FROM ".$this->db->prefix("xoopspoll_desc")." WHERE poll_id=".$id."";
        
$myrow $this->db->fetchArray($this->db->query($sql));
        
$this->assignVars($myrow);
    }

    
// public
    
function hasExpired()
    {
        if ( 
$this->getVar("end_time") > time() ) {
            return 
false;
        }
        return 
true;
    }

    
// public
    
function delete()
    {
        
$sql sprintf("DELETE FROM %s WHERE poll_id = %u"$this->db->prefix("xoopspoll_desc"), $this->getVar("poll_id"));
            if ( !
$this->db->query($sql) ) {
            return 
false;
        }
        return 
true;
    }

    
// private, static
    
function &getAll($criteria=array(), $asobject=true$orderby="end_time DESC"$limit=0$start=0)
    {
        
$db =& Database::getInstance();
        
$ret = array();
        
$where_query "";
        if ( 
is_array($criteria) && count($criteria) > ) {
            
$where_query " WHERE";
            foreach ( 
$criteria as $c ) {
                
$where_query .= $c AND";
            }
            
$where_query substr($where_query0, -4);
        }
        if ( !
$asobject ) {
            
$sql "SELECT poll_id FROM ".$db->prefix("xoopspoll_desc")."$where_query ORDER BY $orderby";
            
$result $db->query($sql,intval($limit),intval($start));
            while ( 
$myrow $db->fetchArray($result) ) {
                
$ret[] = $myrow['poll_id'];
            }
        } else {
            
$sql "SELECT * FROM ".$db->prefix("xoopspoll_desc")."".$where_query." ORDER BY $orderby";
            
$result $db->query($sql,$limit,$start);
            while ( 
$myrow $db->fetchArray($result) ) {
                
$ret[] = new XoopsPoll($myrow);
            }
        }
        
//echo $sql;
        
return $ret;
    }

function 
getcomments($poll_id){
        
$db =& Database::getInstance();
        global 
$module_handler;
        
$pollmod $module_handler->getByDirname('xoopspoll');
        
$sql"SELECT count(com_id) FROM ".$db->prefix('xoopscomments')." WHERE com_modid = '".$pollmod->getVar('mid')."' AND com_itemid = '".$poll_id."'";
        
$result $db->query($sql);
        while (
$row $db->fetchArray($result)) {
            
$amt=$row['count(com_id)'];
        }
        unset(
$pollmod);
        return 
$amt;
    }

    
// public
    
function vote($option_id$ip$user_id=null)
    {
        if (!empty(
$option_id)) {
            if (
is_array($option_id)) {
                foreach (
$option_id as $vote) {
                    
$option = new XoopsPollOption($vote);
                    if ( 
$this->getVar("poll_id") == $option->getVar("poll_id") ) {
                        
$log = new XoopsPollLog();
                        
$log->setVar("poll_id"$this->getVar("poll_id"));
                        
$log->setVar("option_id"$vote);
                        
$log->setVar("ip"$ip);
                        if ( isset(
$user_id) ) {
                            
$log->setVar("user_id"$user_id);
                        }
                        if(!
$log->store()) {
                        } else {
                            
$option->updateCount();
                        }
                    }
                }
            } else {
                
$option = new XoopsPollOption($option_id);
                if ( 
$this->getVar("poll_id") == $option->getVar("poll_id") ) {
                    
$log = new XoopsPollLog();
                    
$log->setVar("poll_id"$this->getVar("poll_id"));
                    
$log->setVar("option_id"$option_id);
                    
$log->setVar("ip"$ip);
                    if ( isset(
$user_id) ) {
                        
$log->setVar("user_id"$user_id);
                    }
                    
$log->store();
                    
$option->updateCount();
                }
            }
            return 
true;
        }
        return 
false;
    }

    
// public
    
function updateCount()
    {
        
$votes XoopsPollLog::getTotalVotesByPollId($this->getVar("poll_id"));
        
$voters XoopsPollLog::getTotalVotersByPollId($this->getVar("poll_id"));
        
$sql ="UPDATE ".$this->db->prefix("xoopspoll_desc")." SET votes=$votes, voters=$voters WHERE poll_id=".$this->getVar("poll_id")."";
        
$this->db->query($sql);
    }


}

?>
I Love Xoops



317
noo-b
Re: xoopspolls - show total comment in block
  • 2007/12/27 5:39

  • noo-b

  • Just can't stay away

  • Posts: 456

  • Since: 2007/10/23


my main page went blank like previously and i turn on the debug

i still got the same message

Fatal error: Call to a member function getByDirname() on a non-object in ..modules\xoopspoll\class\xoopspoll.php

i've updated the module, cleared templates_c

im using 2.0171 and xoopspoll 1.02 (php5)
http://www.xoopsaddons.org/modules/wfdownloads/singlefile.php?lid=1241
I Love Xoops



318
noo-b
Re: database help - user uid
  • 2007/12/27 3:19

  • noo-b

  • Just can't stay away

  • Posts: 456

  • Since: 2007/10/23


thank you bandit ..that does the trick


i 've another question though

it is ok if i change the uid of a user in phpmyadmin

as example from 3 to 5

will it cause problem ?
I Love Xoops



319
noo-b
Re: xoopspolls - show total comment in block
  • 2007/12/27 3:09

  • noo-b

  • Just can't stay away

  • Posts: 456

  • Since: 2007/10/23


thank you banditx

have you tested this yourself ?

i got this message

Fatal error: Call to a member function getByDirname() on a non-object in ...\modules\xoopspoll\class\xoopspoll.php on line 68


Quote:

Bandit-X wrote:
you could.

add a function in the xoopspoll class in the xoopspoll.php file in the module's class folder.
function getcomments($poll_id){
        
$db =& Database::getInstance();
        global 
$module_handler;
        
$pollmod $module_handler->getByDirname('xoopspoll');
        
$sql"SELECT count(com_id) FROM ".$db->prefix('xoopscomments')." WHERE com_modid = '".$pollmod->getVar('mid')."' AND com_itemid = '".$poll_id."'";
        
$result $db->query($sql);
        while (
$row $db->fetchArray($result)) {
            
$amt=$row['count(com_id)'];
        }
        unset(
$pollmod);
        return 
$amt;
    }


After which line actually do i have to put this code ?
I Love Xoops



320
noo-b
Re: database help - user uid
  • 2007/12/26 14:49

  • noo-b

  • Just can't stay away

  • Posts: 456

  • Since: 2007/10/23


thank you wizanda

After i did the change, i tried to register a user, after clicking the finish button i received the message
"cannot register new user"


i'm using 2.0171
I Love Xoops




TopTop
« 1 ... 29 30 31 (32) 33 34 35 ... 37 »



Login

Who's Online

235 user(s) are online (158 user(s) are browsing Support Forums)


Members: 0


Guests: 235


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