91
Zap_English
Re: Publisher Random Item Image

Another question

the file random_item.php is not a large file

where does that code go?

<?php /* You may not change or alter any portion of this comment or credits of supporting developers from this source code or any supporting source code which is considered copyrighted (c) material of the original comment or credit authors. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ /** * @copyright The XUUPS Project http://sourceforge.net/projects/xuups/ * @license http://www.fsf.org/copyleft/gpl.html GNU public license * @package Beverages * @subpackage Blocks * @since 1.0 * @author trabis <lusopoemas@gmail.com> * @author The SmartFactory <www.smartfactory.ca> */ // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); include_once dirname(__DIR__) . '/include/common.php'; /** * @param $options * * @return array */ function beverages_items_random_item_show($options) { $block = array(); $beverages = BeveragesBeverages::getInstance(); // creating the ITEM object $itemsObj = $beverages->getHandler('item')->getRandomItem('', array(BeveragesConstants::BEVERAGES_STATUS_PUBLISHED)); $mainImage = $itemsObj->getMainImage(); // check to see if GD function exist if (!function_exists('imagecreatetruecolor')) { $block['item_image'] = $mainImage['image_path']; } else { $block['item_image'] = PUBLISHER_URL . '/thumb.php?src=' . $mainImage['image_path'] . '&amp;w=' . $imgwidth; // No $imgheight for autoheight option } if (!is_object($itemsObj)) { return $block; } $block['content'] = $itemsObj->getBlockSummary(300, true); //show complete summary but truncate to 300 if only body available $block['id'] = $itemsObj->itemid(); $block['url'] = $itemsObj->getItemUrl(); $block['title'] = $itemsObj->title(); // irmtfan $block['lang_fullitem'] = _MB_BEVERAGES_FULLITEM; return $block; }



92
Zap_English
Re: Publisher Random Item Image

ok, I found it

in items_random_item.php

$mainImage $itemsObj->getMainImage(); // check to see if GD function exist if (!function_exists('imagecreatetruecolor')) { $block['item_image'] = $mainImage['image_path']; } else { $block['item_image'] = PUBLISHER_URL . '/thumb.php?src=' . $mainImage['image_path'] . '&amp;w=' . $imgwidth; // No $imgheight for autoheight option }


template publisher_items_random_item.html

<img src="<{$block.item_image}>" alt="" width="100" height="100" align="left" style="padding:5px;"/>


Now the big question... I also have coding to display a default image if an item doesn't have an assigned imagefrom this thread

So, how can I get the random item block to show the default image, if an assigned image doesn't exist.

Basically, both bits of code have to be merged



93
Zap_English
Publisher Random Item Image

I thought I saw something here about adding the article image to a random item block but I can't find it again

Does anyone know where it is, or how to do it?



94
Zap_English
Re: TdmPicture 1.08 RC 1 available for testing

I've been updating all my sites and I need this to update the last one

Any idea when tdm picture will work on 2.5.9 with xbootstrap?



95
Zap_English
Re: Question about Publisher and Blocks

I figured it out

For anyone else that wants to do the same, You can clone the block and then specify what category you want articles to appear from



96
Zap_English
Re: Automatic image width (for mobile devices)

Quote:

Bleekk wrote:
<img src="..." class="img-responsive">


So you put class="img-responsive" in every image link?



97
Zap_English
Question about Publisher and Blocks

On my front page I want to have the publisher block "Recent Items List"

But I want a different "Recent Items List" for each category

Can I do that, or do I have to create a publisher clone and name it for each category?



98
Zap_English
Re: WTF Shareoholic!

I used to use AddThis but it's a pain in the ass to install and locate on the page where you want it.

Now I use shareaholic. I registered. There's lots of options for button styles, advertising, etc. And it works great, better I think than AddThis

And if you want to monetize your website they have lots of advertising options



99
Zap_English
Re: WTF Shareoholic!

AddThis does have ads, that's why you're not seeing any



100
Zap_English
Re: WTF Shareoholic!

I know how it works because I use it. and when it started popping up ads I was the one that started this thread

Nobody had a problem with it until it started doing that.




TopTop
« 1 ... 7 8 9 (10) 11 12 13 ... 38 »



Login

Who's Online

97 user(s) are online (77 user(s) are browsing Support Forums)


Members: 0


Guests: 97


more...

Donat-O-Meter

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

Latest GitHub Commits