Subject:*
<
Name/Email:*
<
Message Icon:*
<
Select*
<
Message:*
<



Click the Preview to see the content in action.
Options:*
<
Confirmation Code*
<
3 + 4 = ?  
Input the result from the expression
Maximum attempts you can try: 10
*
<
   

Re: use smartys in theme
by Mamba on 2021/11/27 9:19:44

that code will not work, because it is outdated. For example, the line:

le="color: #000000"><?php $publisher =& PublisherPublisher::getInstance();


won't work because "PublisherPublisher" doesn't exist anymore, it has been replaced by "Helper" and namespaces.
Re: use smartys in theme
by heyula on 2021/11/27 8:48:21

Quote:
function.xoMemberInfo.php
Not working in new Publisher module
<?php function smarty_function_publisher_latest($params, &$smarty) { defined("XOOPS_ROOT_PATH") or die("XOOPS root path not defined"); include_once XOOPS_ROOT_PATH . '/modules/publisher/include/common.php'; $publisher =& PublisherPublisher::getInstance(); $myts =& MyTextSanitizer::getInstance(); $itemsObj = $publisher->getHandler('item')->getItems($limit = 1, $start = 0, '', -1, $sort = 'datesub', $order='DESC', '', true, $criteria = null, true); $totalItems = count($itemsObj); for ( $i = 0; $i < $totalItems; $i++ ) { $title = $itemsObj[$i]->title(); $images = $itemsObj[$i]->getImages(); if (is_object($images['main'])) { $image = XOOPS_URL . '/uploads/' . $images['main']->getVar('image_name'); } switch ($params['ret']) { case 'image': echo $image; break; case 'title': echo $title; break; default: echo $image; break; } } } ?>
I think there is a problem because of the following codes
le="color: #000000"><?php defined("XOOPS_ROOT_PATH") or die("XOOPS root path not defined"); include_once XOOPS_ROOT_PATH . '/modules/publisher/include/common.php'; $publisher =& PublisherPublisher::getInstance(); $myts =& MyTextSanitizer::getInstance(); $itemsObj = $publisher->getHandler('item')->getItems($limit = 1, $start = 0, '', -1, $sort = 'datesub', $order='DESC', '', true, $criteria = null, true);
Re: use smartys in theme
by Mamba on 2014/1/9 9:33:44

Quote:
I would suggest you to use publisher instead of the xnews module

+1
Re: use smartys in theme
by Bleekk on 2014/1/9 9:29:14

difference between publisher and xnews is following

<{publisher_latest ret='title'}> returns
le="color: #000000"><?php This is my title

<{xnews_latest ret='title'}> returns
le="color: #000000"><?php <a href="http://linkToArticle">This is my title</a>


If you want it to work like publisher then you need to edit the xnews code.

I would suggest you to use publisher instead of the xnews module
Re: use smartys in theme
by sova on 2014/1/9 8:44:45

Hi
Quote:

Bleekk wrote:
xnews smarty works a little bit different

<{xnews_latest ret='image' topic='25'}> returns a image link
le="color: #000000"><?php <a href="path_to_article"><img src="image.jpg"/></a>


<{xnews_latest ret='title'}> returns a link
le="color: #000000"><?php <a href="path_to_article">article title</a>

Explain more precisely?

----------------------------

This work is being done?
For example,
le="color: #000000"><?php <div id="latest-news"> <{xnews_latest topic='2'}> <{xnews_latest ret='image' width='80'px height='80'px}> <{xnews_latest ret='title' ch='85'}> <{xnews_latest ret='text' ch='220'}> </div>


ch => Characters

Who's Online

488 user(s) are online (447 user(s) are browsing Support Forums)


Members: 0


Guests: 488


more...

Donat-O-Meter

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

Latest GitHub Commits