We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Photo plugin widget -> toprated | Forum

UTAN
UTAN Dec 9 '13
Hi,

I have got photo plugin to show toprated pictures in the photo page correctly,
but if I place a Widget it shows latest instead of toprated...

Now I been lurking in "photo_list_widget.php" and tried to set $menuItems['toprated'] array as 'active' => true , it set the button 'toprated' as active in the index but the photos doesn't change to top rated and are keeps as  latest..

Where is the part where sets the photo menus?

regards.
Daisy Team
Daisy Dec 19 '13
You should go to /ow_plugins/photo/views/components/photo_list_widget.html file and make the following changes:

1. comment the following strings:
<div class="ow_lp_photos ow_center" id="{$items.featured.contId}" style="display: none">
        {foreach from=$featured item='p'}<a class="ow_lp_wrapper" rel="{$p.id}" href="{url_for_route for="view_photo:[id=>`$p.id`]"}"><img src="{$p.url}" /></a>{foreachelse}
            {$nocontent} 
        {/foreach}
    </div>

    {if $latest}
    <div class="ow_lp_photos ow_center" id="{$items.latest.contId}">
        {foreach from=$latest item='p'}<a class="ow_lp_wrapper" rel="{$p.id}" href="{url_for_route for="view_photo:[id=>`$p.id`]"}"><img src="{$p.url}" /></a>{foreachelse}
            {$nocontent}
        {/foreach}
    </div>
    {/if}

2. remove the style="display: none" for the toprated clause.
3. comment the following strings:

{if $featured}<div id="photo-widget-toolbar-featured" style="display: none">{decorator name='box_toolbar' itemList=$toolbars.featured}</div>{/if}
{if $latest}<div id="photo-widget-toolbar-latest" style="display: none">{decorator name='box_toolbar' itemList=$toolbars.latest}</div>{/if}
UTAN
UTAN Dec 20 '13
@Daysi,

Thank you for you post, but are we on the same version?, this is have what I got.. I don't latest "statement":

<div id="photo_list_widget">

    {if $latest || $featured || $toprated} {if isset($menu)}{$menu}{/if} {/if}
   
    {capture assign='nocontent'}
       <div class="ow_nocontent">{text key='photo+no_photo'}, <a href="{url_for for="PHOTO_CTRL_Upload:index"}">{text key='photo+add_new'}</a></div>
    {/capture}
   
    <div class="ow_lp_photos ow_center" id="{$items.latest.contId}">
        {foreach from=$latest item='p'}<a class="ow_lp_wrapper" rel="{$p.id}" href="{url_for_route for="view_photo:[id=>`$p.id`]"}"><img src="{$p.url}" /></a>{foreachelse}
            {$nocontent}
        {/foreach}
    </div>

    {if $featured}
    <div class="ow_lp_photos ow_center" id="{$items.featured.contId}" style="display: none">
        {foreach from=$featured item='p'}<a class="ow_lp_wrapper" rel="{$p.id}" href="{url_for_route for="view_photo:[id=>`$p.id`]"}"><img src="{$p.url}" /></a>{foreachelse}
            {$nocontent} 
        {/foreach}
    </div>
    {/if}
   
    <div class="ow_lp_photos ow_center" id="{$items.toprated.contId}" style="display: none">
        {foreach from=$toprated item='p'}<a class="ow_lp_wrapper" rel="{$p.id}" href="{url_for_route for="view_photo:[id=>`$p.id`]"}"><img src="{$p.url}" /></a>{foreachelse}
            {$nocontent}  
        {/foreach}
    </div>

    {if $latest}<div id="photo-widget-toolbar-latest" style="display: none">{decorator name='box_toolbar' itemList=$toolbars.latest}</div>{/if}
    {if $featured}<div id="photo-widget-toolbar-featured" style="display: none">{decorator name='box_toolbar' itemList=$toolbars.featured}</div>{/if}   
    {if $toprated}<div id="photo-widget-toolbar-top-rated" style="display: none">{decorator name='box_toolbar' itemList=$toolbars.toprated}</div>{/if}
   
</div>
The Forum post is edited by UTAN Dec 20 '13
Daisy Team
Daisy Dec 23 '13
The code you've provided is similar to mine. All you need is to comment the following strings:

  <div class="ow_lp_photos ow_center" id="{$items.latest.contId}">
        {foreach from=$latest item='p'}<a class="ow_lp_wrapper" rel="{$p.id}" href="{url_for_route for="view_photo:[id=>`$p.id`]"}"><img src="{$p.url}" /></a>{foreachelse}
            {$nocontent}
        {/foreach}
    </div>

    {if $featured}
    <div class="ow_lp_photos ow_center" id="{$items.featured.contId}" style="display: none">
        {foreach from=$featured item='p'}<a class="ow_lp_wrapper" rel="{$p.id}" href="{url_for_route for="view_photo:[id=>`$p.id`]"}"><img src="{$p.url}" /></a>{foreachelse}
            {$nocontent} 
        {/foreach}
    </div>
    {/if}
UTAN
UTAN Dec 24 '13
Thanks , again for you kind support..

I ended up doing the following:

used paste bin photo_list_widget.html

Add CSS directive to of display:none to div id with variable id="{$items.latest.contId}" and change CSS directive to div with variable {$items.toprated.contId} to display:block , and finally go to  ow_plugins\photo\components\photo_list_widget.php edit this file.

Find $menuItems['latest'] array and comment 'active' => false  properties.
then
Find $menuItems['toprated'] array and add propertie 'active' => true should be all we need to edit.
it should look like this:

photo_list_widget.php

Hopes this helps some other soul..

reiterate my gratitude Daysi.
The Forum post is edited by UTAN Dec 24 '13
Daisy Team
Daisy Dec 25 '13
You are always welcome.
Yaşar Taner
Yaşar Taner Jul 10 '14
Hi. My web site's photo widget not show. What can I do?
www.myspacesarts.com
The Forum post is edited by Yaşar Taner Jul 10 '14
Alia Team
Alia Jul 11 '14
Yaşar Taner, if your question is not related to the modification discussed in this topic, I recommend reporting your issue in "Bugs Reports & Troubleshooting" section of our forum.
Jordi
Jordi Feb 14 '15
Hi is this still the same in the recent plugin version?

i also want top rated as standaard in the photos widget

UTAN
UTAN Feb 16 '15
Changes a little bit.. I can't even remember where I found them..