1571
mjoel
Adding Main Image in Publisher - Item by same author page
  • 2020/2/15 15:57

  • mjoel

  • Quite a regular

  • Posts: 325

  • Since: 2006/12/9


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



1572
goffy
Re: use line-break in tpl files
  • 2020/2/14 15:58

  • goffy

  • Just can't stay away

  • Posts: 535

  • Since: 2010/12/27


hi zyspec
hi geekwright

sometime you can't see the forrest because of the trees

thanks, both is working
Quote:
$xoopsMailer->assign('RESULT', 'Newsletter 1' . chr(10) . 'Newsletter 2' . chr(10) . 'Newsletter 3');

Quote:
$xoopsMailer->assign('RESULT', "Newsletter 1 \n Newsletter 2 \n Newsletter 3");



1573
geekwright
Re: use line-break in tpl files

Quote:
goffy wrote: ... if I use
$xoopsMailer->assign('RESULT''Newsletter 1
Newsletter 2
Newsletter 3);
I get in the mails also Quote:
Newsletter 1
Newsletter 2
Newsletter 3
the same with \r\n, \r or \n how can I get a line break?
The string is defined in single quotes, so the \n and \r each are treated as 2 characters, not the control character you expect. https://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.single



1574
zyspec
Re: use line-break in tpl files
  • 2020/2/13 22:41

  • zyspec

  • Module Developer

  • Posts: 1095

  • Since: 2004/9/21


@goffy,

This may depend on if you're sending the email as HTML or plain text. $xoopsMailer->setHTML(true|false);

Instead of using
$xoopsMailer->assign('RESULT''Newsletter 1
Newsletter 2
Newsletter 3);

I would suggest you try something like:
$xoopsMailer->assign('RESULT''Newsletter 1' chr(10) . 'Newsletter 2' chr(10) . 'Newsletter 3');


Let us know what you find out....



1575
goffy
use line-break in tpl files
  • 2020/2/13 21:44

  • goffy

  • Just can't stay away

  • Posts: 535

  • Since: 2010/12/27


Hi

I have a specific problem in xnewsletter:
I am sending various mails based on a tpl-file.
the tpl looks e.g. like this:
Quote:
Dear {SEX} {FIRSTNAME} {LASTNAME}

You have requested the registrations of email address {EMAIL}.
This email address is currently registered for following newsletters:
{RESULT}

You can change registrations by following link:
{CHANGELINK}

-----------------------
{X_SITENAME}
({X_SITEURL})
Webmaster {X_ADMINMAIL}


To fill in this tpl I use e.g.
....      
$xoopsMailer->setTemplate('subscriptions.tpl');
.....
$xoopsMailer->assign('FIRSTNAME'$firstname);

and this is working fine.

but now I create a list of all newsletter, where someone is subscribed and it should look like
Quote:
Newsletter 1
Newsletter 2
Newsletter 3


if I use
$xoopsMailer->assign('RESULT''Newsletter 1
Newsletter 2
Newsletter 3);

I get in the mails also Quote:
Newsletter 1
Newsletter 2
Newsletter 3

the same with \r\n, \r or \n

how can I get a line break?



1576
mjoel
Re: wgGallery 1.10 ready for testing
  • 2020/2/11 0:33

  • mjoel

  • Quite a regular

  • Posts: 325

  • Since: 2006/12/9


ok thanks noted goffy



1577
clara2020
Re: What to expect in PHP 8
  • 2020/2/10 23:14

  • clara2020

  • Just popping in

  • Posts: 1

  • Since: 2020/2/10


Thanks for the link Mamba, i was looking for this guide PHP 8 and some news about it.



1578
goffy
Re: wgGallery 1.10 ready for testing
  • 2020/2/10 12:24

  • goffy

  • Just can't stay away

  • Posts: 535

  • Since: 2010/12/27


Hi

you need min PHP 7.*



1579
mjoel
Re: wgGallery 1.10 ready for testing
  • 2020/2/10 3:55

  • mjoel

  • Quite a regular

  • Posts: 325

  • Since: 2006/12/9


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



1580
cadch
Re: What to expect in PHP 8
  • 2020/2/10 2:51

  • cadch

  • Just popping in

  • Posts: 48

  • Since: 2007/12/17


Exciting Features to Look Forward in PHP 8




TopTop
« 1 ... 155 156 157 (158) 159 160 161 ... 29425 »



Login

Who's Online

303 user(s) are online (57 user(s) are browsing Support Forums)


Members: 0


Guests: 303


more...

Donat-O-Meter

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

Latest GitHub Commits