xoops forums

Forum Index


Board index » All Posts (luciorota)




luciorota

Module Developer
Posted on: 7/14 7:51
luciorota
luciorota (Show more)
Module Developer
Posts: 205
Since: 2007/4/20
#1

Re: More old modules available on GitHub

Well done!


luciorota

Module Developer
Posted on: 4/29 15:55
luciorota
luciorota (Show more)
Module Developer
Posts: 205
Since: 2007/4/20
#2

Re: Re-Design the PM templates - Need smarty help

Trry this
More than dirty

<{if ($message.postername != "")}>
<{* 
what if user does not exist? *}>
<{
assign var="tempPosteruid" value=$message.posteruid}>
<
img src="<{$xoops_url}>/uploads/<{php}>
    
$user_handler = xoops_getHandler('user');
    if(
$posterObj = $user_handler->get($this->get_template_vars('tempPosteruid'))) {
        echo 
$posterObj->getVar('user_avatar');
    }
    <{/php}>" 
class="img-responsive img-rounded img-thumbnail">
<{/if}>


luciorota

Module Developer
Posted on: 4/29 14:26
luciorota
luciorota (Show more)
Module Developer
Posts: 205
Since: 2007/4/20
#3

Re: Re-Design the PM templates - Need smarty help

To get user_avatar this way is a dirty way.. but it could run!

Insert in "viewpmsg.tpl" file
into the <{foreach item=message from=$messages}> loop
this Smarty code

<{php}>
    
$user_handler xoops_getHandler('user');
    
$posterObj $user_handler->get($GLOBALS['message']['posteruid']);
    echo 
$posterObj->getVar('user_avatar');
<{/
php}>


Good luck!


luciorota

Module Developer
Posted on: 4/29 14:10
luciorota
luciorota (Show more)
Module Developer
Posts: 205
Since: 2007/4/20
#4

Re: Re-Design the PM templates - Need smarty help

Hi Alain01

Is becouse $message.posteruid is the poster id and not a poster object


luciorota

Module Developer
Posted on: 4/22 19:56
luciorota
luciorota (Show more)
Module Developer
Posts: 205
Since: 2007/4/20
#5

Re: Datetime problems with Publisher 1.07 Final and Xoops 2.5.10

Try again ... Xoops using "\DateTime" and not "DateTime"
Quote:

luciorota wrote:
The bug is the result of an incorrect use of the function strtotime(), it must have a format in English to work...

BUGFIX

file: publisher\class\item.php, line 1061
replace
$localTimestamp strtotime($resDate['date']) + $resTime['time'];


with
$dateTimeObj \DateTime::createFromFormat(_SHORTDATESTRING$resDate['date']);
$dateTimeObj->setTime(000);
$localTimestamp $dateTimeObj->getTimestamp() + $resTime['time'];


file: publisher\class\item.php, line 1088

replace
$localTimestamp strtotime($resExDate['date']) + $resExTime['time'];


with
$dateTimeObj \DateTime::createFromFormat(_SHORTDATESTRING$resExDate['date']);
$dateTimeObj->setTime(000);
$localTimestamp $dateTimeObj->getTimestamp() + $resExTime['time'];


Good job! / Buon lavoro!


luciorota

Module Developer
Posted on: 4/22 12:23
luciorota
luciorota (Show more)
Module Developer
Posts: 205
Since: 2007/4/20
#6

Re: Datetime problems with Publisher 1.07 Final and Xoops 2.5.10

I know


luciorota

Module Developer
Posted on: 4/21 19:18
luciorota
luciorota (Show more)
Module Developer
Posts: 205
Since: 2007/4/20
#7

Re: Datetime problems with Publisher 1.07 Final and Xoops 2.5.10

The bug is the result of an incorrect use of the function strtotime(), it must have a format in English to work...

BUGFIX

file: publisher\class\item.php, line 1061
replace
$localTimestamp strtotime($resDate['date']) + $resTime['time'];


with
$dateTimeObj DateTime::createFromFormat(_SHORTDATESTRING$resDate['date']);
$dateTimeObj->setTime(000);
$localTimestamp $dateTimeObj->getTimestamp() + $resTime['time'];


file: publisher\class\item.php, line 1088

replace
$localTimestamp strtotime($resExDate['date']) + $resExTime['time'];


with
$dateTimeObj DateTime::createFromFormat(_SHORTDATESTRING$resExDate['date']);
$dateTimeObj->setTime(000);
$localTimestamp $dateTimeObj->getTimestamp() + $resExTime['time'];


Good job! / Buon lavoro!


luciorota

Module Developer
Posted on: 4/21 17:59
luciorota
luciorota (Show more)
Module Developer
Posts: 205
Since: 2007/4/20
#8

Re: Datetime problems with Publisher 1.07 Final and Xoops 2.5.10

Hi Lupin /Ciao Lupin

Do not change

define('_DBDATESTRING',"Y-m-d");
define('_DBTIMESTRING',"H:i:s");
define('_DBTIMESTAMPSTRING',"Y-m-d H:i:s");


These definition are db related (MySQL date and time data types) and they are NOT dependent on the language used ...

Lucio


luciorota

Module Developer
Posted on: 2019/9/12 13:58
luciorota
luciorota (Show more)
Module Developer
Posts: 205
Since: 2007/4/20
#9

Re: xoopsClone issues

Thanks

Quote:

One potential problem is that the XoopsObject has no internal knowledge of it's primary key, so while the object is marked new, it still has any auto-increment PK set. You can work around this issue by doing a $newObject->destroyVars('key-variable-name'); to clean up after a clone.


In fact this is a problem I encountered

Also $vars[$key]['changed'] property si cloned as false, for this reason the cloned object cannot be correctly stored in the database.

In your opinion, can it make sense to correct the xoopsClone() method to create working objects?
Thx


luciorota

Module Developer
Posted on: 2019/9/11 9:52
luciorota
luciorota (Show more)
Module Developer
Posts: 205
Since: 2007/4/20
#10

xoopsClone issues

Someone can explain to me the correct use of the xoopsClone() method?



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