41
heyula
New Block for Publisher Module
  • 2021/11/27 11:11

  • heyula

  • Theme Designer

  • Posts: 590

  • Since: 2008/4/24


With this code, you can pull content added to the publisher module wherever you want in your theme. Add to your theme:
<{includeq file="$theme_name/random-news.tpl"}>
or 
<{
includeq file="$theme_name/date-news.tpl"}>
Code Content : Random News :
<{php}>
use 
XoopsModulesPublisher;
use 
XoopsModulesPublisherConstants;

$helper PublisherHelper::getInstance();
$myts =& MyTextSanitizer::getInstance();
$itemsObj $helper->getHandler('Item')->getItems($limit 3$start 0, [Constants::PUBLISHER_STATUS_PUBLISHED], -1$sort 'RAND()'$order=''''true$criteria null);
$totalItems count($itemsObj);

global 
$items;
$items = array();
if (
$itemsObj) {
    for ( 
$i 0$i $totalItems$i++ ) {
        
$newItems['itemid']       = $itemsObj[$i]->itemid();
        
$newItems['title']        = $itemsObj[$i]->title();
        
$newItems['body']         = $itemsObj[$i]->body();
        
$newItems['votes']        = $itemsObj[$i]->votes();
        
$newItems['image']        = XOOPS_URL '/uploads/blank.gif';
        
$images $itemsObj[$i]->getImages();
        if (
is_object($images['main'])) {
            
$newItems['image'] = XOOPS_URL '/uploads/' $images['main']->getVar('image_name');
        }
    
$items[] = $newItems;
    }
}
<{/
php}>
<!-- 
Slider -->
        
        
            <{
php}>
        foreach ( 
$GLOBALS['items'] as $myrow )
        {
            
$GLOBALS['xoopsTpl']->assign('itemid'$myrow['itemid']);
            
$GLOBALS['xoopsTpl']->assign('title'$myrow['title']);
            
$GLOBALS['xoopsTpl']->assign('body'$myrow['body']);
            
$GLOBALS['xoopsTpl']->assign('votes'$myrow['votes']);
            
$GLOBALS['xoopsTpl']->assign('image'$myrow['image']);
        <{/
php}>
<
div class="col-lg-4 col-md-12 col-xl-4">
<
div class="card">
                <
div class="img-fix-height cover-image">
                <
img src="<{$image}>">
                </
div>
                <
div class="card-body p-4">
                    <
a href="<{$xoops_url}>/modules/publisher/item.php?itemid=<{$itemid}>" class="text-dark"><h4 class="font-weight-semibold text-truncate mb-3"><{$title}></h4></a>
                    <
class="fix-max-height"><{$body|truncate:230}></p>
                    <
br>
                    <
class="btn btn-primary btn-teal" href="<{$xoops_url}>/modules/publisher/item.php?itemid=<{$itemid}>">Read more</a>
                </
div>
</
div>
</
div>
        <{
php}>
        }
        <{/
php}>
Date News :
<{php}>
use 
XoopsModulesPublisher;
use 
XoopsModulesPublisherConstants;

$helper PublisherHelper::getInstance();
$myts =& MyTextSanitizer::getInstance();
$itemsObj $helper->getHandler('Item')->getItems($limit 3$start 0, [Constants::PUBLISHER_STATUS_PUBLISHED], -1$sort 'datesub'$order='DESC'''true$criteria null);
$totalItems count($itemsObj);

global 
$items;
$items = array();
if (
$itemsObj) {
    for ( 
$i 0$i $totalItems$i++ ) {
        
$newItems['itemid']       = $itemsObj[$i]->itemid();
        
$newItems['title']        = $itemsObj[$i]->title();
        
$newItems['body']         = $itemsObj[$i]->body();
        
$newItems['votes']        = $itemsObj[$i]->votes();
        
$newItems['image']        = XOOPS_URL '/uploads/blank.gif';
        
$images $itemsObj[$i]->getImages();
        if (
is_object($images['main'])) {
            
$newItems['image'] = XOOPS_URL '/uploads/' $images['main']->getVar('image_name');
        }
    
$items[] = $newItems;
    }
}
<{/
php}>
<!-- 
Slider -->
        
        
            <{
php}>
        foreach ( 
$GLOBALS['items'] as $myrow )
        {
            
$GLOBALS['xoopsTpl']->assign('itemid'$myrow['itemid']);
            
$GLOBALS['xoopsTpl']->assign('title'$myrow['title']);
            
$GLOBALS['xoopsTpl']->assign('body'$myrow['body']);
            
$GLOBALS['xoopsTpl']->assign('votes'$myrow['votes']);
            
$GLOBALS['xoopsTpl']->assign('image'$myrow['image']);
        <{/
php}>
<
div class="col-lg-4 col-md-12 col-xl-4">
<
div class="card">
                <
div class="img-fix-height cover-image">
                <
img src="<{$image}>">
                </
div>
                <
div class="card-body p-4">
                    <
a href="<{$xoops_url}>/modules/publisher/item.php?itemid=<{$itemid}>" class="text-dark"><h4 class="font-weight-semibold text-truncate mb-3"><{$title}></h4></a>
                    <
class="fix-max-height"><{$body|truncate:230}></p>
                    <
br>
                    <
class="btn btn-primary btn-teal" href="<{$xoops_url}>/modules/publisher/item.php?itemid=<{$itemid}>">Read more</a>
                </
div>
</
div>
</
div>
        <{
php}>
        }
        <{/
php}>
Definitions in Code : 7th in line of code
$limit 3  How many articles are published
$start 
0  From which category (for all categories)
Template:
<{$title}> = Article Title
<{$itemid}> = Article ID
<{$body|truncate:230}> = Article Content
<{$xoops_url}>/modules/publisher/item.php?itemid=<{$itemid}> = Article Link
<{$image}> = Article Image
<{$votes}> = Article Votes
Sample: Resized Image
Download:https://erenyumak.com/modules/TDMDownloads/singlefile.php?lid=12



42
heyula
Re: use smartys in theme
  • 2021/11/27 8:48

  • heyula

  • Theme Designer

  • Posts: 590

  • Since: 2008/4/24


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 nulltrue);
    
$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
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 nulltrue);



43
heyula
My New Xoops Project
  • 2021/11/22 11:41

  • heyula

  • Theme Designer

  • Posts: 590

  • Since: 2008/4/24


Resized Image


Modules Used :

- Publisher
- xforms
- xmcontent

Demo:

https://www.togaysan.com.tr/



44
heyula
Re: My Latest Xoops Project
  • 2021/10/8 21:46

  • heyula

  • Theme Designer

  • Posts: 590

  • Since: 2008/4/24


Thanks for your nice comments.

Finally, I adapted the slideshow module for the slide section.

Resized Image


I adapted mymenus module for menus

Resized Image



45
heyula
My Latest Xoops Project
  • 2021/10/7 12:47

  • heyula

  • Theme Designer

  • Posts: 590

  • Since: 2008/4/24


Resized Image


Resized Image


Resized Image


Resized Image


My new xoops project I'm working on.

I continue to develop the site

Modules I Use

- Publisher
- Xmnews
- Xoops Faq
- Xmcontent
- Tag
- Slideshow
- Contact Us

Demo:

https://www.invitahome.com/

Hasta Yatakları



46
heyula
Re: THEME CONSTRA
  • 2021/9/27 8:11

  • heyula

  • Theme Designer

  • Posts: 590

  • Since: 2008/4/24


Which module blocks do you want to use?



47
heyula
Product Comparison Module
  • 2021/8/3 15:20

  • heyula

  • Theme Designer

  • Posts: 590

  • Since: 2008/4/24


Product Comparison Module

a module created with modulebuilder.

Resized Image


Resized Image


Resized Image


Demo:

https://xoops.erenyumak.com/modules/xhcontent/products.php

I will post it soon



48
heyula
Re: wgDiaries 1.03 RC1 ready for testing
  • 2021/6/18 11:35

  • heyula

  • Theme Designer

  • Posts: 590

  • Since: 2008/4/24


I just tested the module it's really nice.



49
heyula
Xoops Bootstrap 5 Theme
  • 2021/6/13 20:06

  • heyula

  • Theme Designer

  • Posts: 590

  • Since: 2008/4/24


Xoops Bootstrap 5 Theme

Hello friends;

I started a new Bootstrap 5 compatible theme for Xoops users.

Waiting for your comments and suggestions.

Resized Image


XMNEWS:

Resized Image


PUBLISHER:

Resized Image


CONTACTS:

Resized Image



50
heyula
Re: Spotify Api v1.07 RC 3
  • 2021/4/10 16:59

  • heyula

  • Theme Designer

  • Posts: 590

  • Since: 2008/4/24


Thanks for sharing




TopTop
« 1 2 3 4 (5) 6 7 8 ... 24 »



Login

Who's Online

114 user(s) are online (87 user(s) are browsing Support Forums)


Members: 0


Guests: 114


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