xoops forums

Forum Index


Board index » All Posts (mjoel)




mjoel

Quite a regular
Posted on: 2/22 3:12
mjoel
mjoel (Show more)
Quite a regular
Posts: 297
Since: 2006/12/9
#1

Re: countdown module for XOOPS 2.5.9 ?

Quote:

Mamba wrote:
You can try and test these two versions:

Version 1: the original version, updated for XOOPS 2.5.9 and PHP 7.2, but the the calendar button doesn't work, i.e. you have to enter the date manually

Version 2: Quick & dirty rewrite of the Version 1, incl. a Vue countdown component.

Please note: I don't have time to do anything more with these modules, but it will be a good start for you to improve it further. Or somebody else could help you. Just fork it on GitHub


version 1 can be install

can't install version2 blank page no debug error

XOOPS Version XOOPS 2.5.10
PHP Version 5.6.25
mySQL Version 5.7.14

can anybody suggest a fix


mjoel

Quite a regular
Posted on: 2/17 4:11
mjoel
mjoel (Show more)
Quite a regular
Posts: 297
Since: 2006/12/9
#2

Re: Adding Main Image in Publisher - Item by same author page

Thank you mamba..code is working fine


mjoel

Quite a regular
Posted on: 2/16 10:31
mjoel
mjoel (Show more)
Quite a regular
Posts: 297
Since: 2006/12/9
#3

Re: Adding Main Image in Publisher - Item by same author page

i'm trying to add main image of the article at the top of every article title in the author page
example of author items page here in xoops.org
Resized Image


not sure what the problem is i tried to paste my image codethat i used in publisher_author_items.tpl but its not appearing correcly in my last post and in this post this is the screenshot of the code
Resized Image

?>


mjoel

Quite a regular
Posted on: 2/15 15:57
mjoel
mjoel (Show more)
Quite a regular
Posts: 297
Since: 2006/12/9
#4

Adding Main Image in Publisher - Item by same author page

Hi i would like to add main image of article in Publisher item by same author page

here's what i did so far following from some example ... but its not working..i got 500 error page

in publisher/author_items.php...my image code is after the line rating
..i added the bold part
$categories[$catId]['count_items']++;
        
$categories[$catId]['count_hits'] += $item->counter();
        
$categories[$catId]['items'][]    = [
            
'title'     => $item->getTitle(),
            
'hits'      => $item->counter(),
            
'link'      => $item->getItemLink(),
            
'published' => $item->getDatesub(_SHORTDATESTRING),
            
//'rating'    => $xoopsLocal->number_format((float)$item->rating())
            
'rating'    => $item->rating(),
          
'image'     => $item->getMainImage(),
        ];
        
$mainImage       $item->getMainImage();
        
// check to see if GD function exist
        
if (!function_exists('imagecreatetruecolor')) {
            
$item['image'] = $mainImage['image_path'];
        } else {
            
$item['image'] = PUBLISHER_URL '/thumb.php?src=' $mainImage['image_path'] . '&w=' $imgWidth// No $imgHeight for autoheight option
           
}
    }
    
}


in template publisher_author_items.tpl i used

$item.item_image

please help thank you


mjoel

Quite a regular
Posted on: 2/11 0:33
mjoel
mjoel (Show more)
Quite a regular
Posts: 297
Since: 2006/12/9
#5

Re: wgGallery 1.10 ready for testing

ok thanks noted goffy


mjoel

Quite a regular
Posted on: 2/10 3:55
mjoel
mjoel (Show more)
Quite a regular
Posts: 297
Since: 2006/12/9
#6

Re: wgGallery 1.10 ready for testing

Hi i downloaded the latest version in github wggallery 1.14 RC1 for testing

when installing i received this error

Failed to execute xoops_module_pre_install_wggallery

XOOPS Version XOOPS 2.5.10
PHP Version 5.6.40
mySQL Version 5.7.29


mjoel

Quite a regular
Posted on: 2/1 5:28
mjoel
mjoel (Show more)
Quite a regular
Posts: 297
Since: 2006/12/9
#7

Re: a simple method to return the groups names of a user

Quote:

mjoel wrote:
i tried it like this

global $xoopsUser;
//get current user id 
//$uid = is_object($xoopsUser) ? $xoopsUser->getVar('uid') : t; 
$uid=$row['uid'];
//get groups from this user, if any 
$member_handler =& xoops_gethandler('member'); 
$groups =& $member_handler->getGroupsByUser($uidtrue); 

//the above method will give as an array of objects, lets get the name of each group  
$usergroups = array(); 
foreach (
$groups as $group) { 
    
$usergroups[] = $group->getVar('name'); 
}
$usergroupsArray implode(', '$usergroups);
echo 
$usergroupsArray;


i have more than 400 users ..only the group for 31 users is displayed before i get this error

Fatal errorCall to a member function getVar() on a non-object in custom.php on line 354


line 354 in my file custom.php refers to
$usergroups[] = $group->getVar('name');


is the code above working for XOOPS 2.5.10..help

XOOPS Version XOOPS 2.5.10
PHP Version 5.4.27
mySQL Version 5.5.36


i figured this out

in my database groups_users_link table there is user with groupid=0 .. im not sure how that happen

but i deleted all the user with groupid=0 ..and now all is well..the code above is working fine


mjoel

Quite a regular
Posted on: 2/1 3:56
mjoel
mjoel (Show more)
Quite a regular
Posts: 297
Since: 2006/12/9
#8

Re: a simple method to return the groups names of a user

i tried it like this

global $xoopsUser;
//get current user id 
//$uid = is_object($xoopsUser) ? $xoopsUser->getVar('uid') : t; 
$uid=$row['uid'];
//get groups from this user, if any 
$member_handler =& xoops_gethandler('member'); 
$groups =& $member_handler->getGroupsByUser($uidtrue); 

//the above method will give as an array of objects, lets get the name of each group  
$usergroups = array(); 
foreach (
$groups as $group) { 
    
$usergroups[] = $group->getVar('name'); 
}
$usergroupsArray implode(', '$usergroups);
echo 
$usergroupsArray;


i have more than 400 users ..only the group for 31 users is displayed before i get this error

Fatal errorCall to a member function getVar() on a non-object in custom.php on line 354


line 354 in my file custom.php refers to
$usergroups[] = $group->getVar('name');


is the code above working for XOOPS 2.5.10..help

XOOPS Version XOOPS 2.5.10
PHP Version 5.4.27
mySQL Version 5.5.36


mjoel

Quite a regular
Posted on: 1/29 3:30
mjoel
mjoel (Show more)
Quite a regular
Posts: 297
Since: 2006/12/9
#9

Re: help with mysql xoops query and msaccess database

nevermind i got it..thanks again to zyspec for the help
// get the Access dB departments Name not in XOOPS
$accessQuery1 "SELECT DEPTID, DEPTNAME FROM DEPARTMENTS WHERE DEPTNAME NOT IN ('$deptNameArray')";
$rs1 odbc_exec($conn$accessQuery1);
if (!
$rs1) {
    exit(
"Error in SQL");
}

// now update departments into 'mydepartments' table
while(odbc_fetch_row($rs1)){
$deptId=odbc_result($rs1,"DEPTID");
$deptName=odbc_result($rs1,"DEPTNAME"); 
 
$updateprocess$GLOBALS['xoopsDB']->query("UPDATE ".$xoopsDB->prefix("mydepartments")."
SET DEPTNAME='
$deptName' WHERE DEPTID='$deptId'");
}

// get the Access dB all departments
$accessQuery2 "SELECT DEPTID FROM DEPARTMENTS";
$rs2 odbc_exec($conn$accessQuery2);
if (!
$rs2) {
    exit(
"Error in SQL");
}

// now delete department in 'mytr_departments' table
while(odbc_fetch_row($rs2)){
$deptId2[]=odbc_result($rs2,"DEPTID");
}
$deptIdArray2 implode(', '$deptId2);
$deleteprocess=$GLOBALS['xoopsDB']->queryF("DELETE FROM ".$xoopsDB->prefix("mydepartments").
WHERE DEPTID NOT IN (
$deptIdArray2)");


mjoel

Quite a regular
Posted on: 1/28 8:18
mjoel
mjoel (Show more)
Quite a regular
Posts: 297
Since: 2006/12/9
#10

Re: help with mysql xoops query and msaccess database

How about update process if there's changes in access db departments update it in xoops db mydepartments

whats the best way to combine with the code above ?

UPDATE mydepartments AS mydepartmentsdepartments AS departments 
SET mydepartments
.DEPTNAME departments.DEPTNAME
WHERE departments
.DEPTID mydepartments.DEPTID;



TopTop
(1) 2 3 4 ... 25 »