ZoranM

Activity

  • ZoranM replied on the discussion topic Extracting number from vars[entity] HELP!!!
    Thanks again for the help Khayredinov! I tried as you sugested. It did not worked eather. I realy dont understand how this whole thing works, or it is supposed to work. Here is again what I did : <?php $guid = (int)... view reply
  • ZoranM replied on the discussion topic Extracting number from vars[entity] HELP!!!
    Hi Khayredinov,   I tried the way as you sugested, but it did not worked.The $vars['entity']->checkedImage was alwas giving back an empty array. So what I did it in another way:    1. I kept the form structure as it... view reply
  • ZoranM added a new discussion topic Extracting number from vars[entity] HELP!!! in the group Tidypics Photo Gallery Plugin
    Hi to all,   I am trying to develope a widget for Tidypics and I am in arealy big trouble. Can someone help me?I did not know that it is going to be so complicated. I have a form and the "name" atribute I stored it in a params[] array.In this...
    • I don't understand why are you using your image_guid array for owner_guids...

      foreach ($product_guids as $im) {

      elgg_view_entity($im);

      }

       

      You don't need to get an array of entities to display them. 

    • Thanks again for the help Khayredinov! I tried as you sugested. It did not worked eather. I realy dont understand how this whole thing works, or it is supposed to work. Here is again what I did :

      <?php

      $guid = (int) get_input('guid');
                 $filtered_psettings = 0;
                 $entity = $vars['entity'];
                 $psettings = get_all_private_settings($entity->guid);
                 $filtered_psettings = array_keys($psettings, "checkedImage");
                 $product_guids = array_values($filtered_psettings);

                 foreach ($product_guids as $im){

                 echo elgg_view_entity($im);

                 }

      ?>

      At the end it returns "boolean false" which it seams that the values in $product_guid array are not an "instanceof ElggEntity". This are only the guids. But should the guids be an instance of ElggEntity? Sorry this might sound stupid question, but I am still trying to learn. Thanks for the help in advance!

    • What is the first place to look for an answer? Tidypics plugin:

      1. tidypics/views/default/widgets/latest_photos

      line 11: tp_get_latest_photos

      2. tidypics/lib/tidypics

      line 36: tp_list_entities

      line 172: tp_view_entity_list

      line 178:  $html = elgg_view('tidypics/gallery',array(

      'entities' => $entities,

      'count' => $count,

      'offset' => $offset,

      'limit' => $limit,

      'baseurl' => $_SERVER['REQUEST_URI'],

      'fullview' => $fullview,

      'context' => $context,

      'viewtypetoggle' => $viewtypetoggle,

      'viewtype' => get_input('search_viewtype','list'),

      'pagination' => $pagination

      ));

       

      So pass your entity list to the elgg_view('tidypics/gallery') and see what happens

  • ZoranM replied on the discussion topic Which function is for pulling pictures
    Hi guys!  After several days I managed to do this. The only problem that I have now is that when I select any picture by the checkboxes it is not showing the chosen pictures. I dont know wheather I have made some mistake by saving it as a... view reply
  • ZoranM replied on the discussion topic Which function is for pulling pictures
    Thanks Khayredinov. I will have a look at it and I'll let you know for the progress.  All the best! view reply
  • ZoranM added a new discussion topic Which function is for pulling pictures in the group Tidypics Photo Gallery Plugin
    Hi guys, What I am trying to do these days is showing sellected pictures into the widget "Latest photos" from Tidypics. I do the selection by check boxes which I put under each picture and also a "submit" button which after the selection of the...
    • The best way to do it is by creating an edit.php for your widget, where the user can select images from tidypics. An array of image guids should be saved as a widget metadata (that's done automatically in edit.php form (check blog plugin for an example). In view.php for your widget, get your metadata with guids, iterate through your array and echo elgg_view_entity

    • Thanks Khayredinov. I will have a look at it and I'll let you know for the progress. 

      All the best!

    • Hi guys! 

      After several days I managed to do this. The only problem that I have now is that when I select any picture by the checkboxes it is not showing the chosen pictures. I dont know wheather I have made some mistake by saving it as a metadata in the database or something else is the problem. Any help is very welcommed.

      edit.php :

      <p>

      <?php 

      echo elgg_echo("tidypics:widget:num_latest") . ": ";

       

      if($vars['entity']->num_display == '') $vars['entity']->num_display = 6;

       

      ?>

      <select name="params[num_display]">

      <option value="6" <?php if($vars['entity']->num_display == 6) echo "SELECTED"; ?>>6</option>

      <option value="9" <?php if($vars['entity']->num_display == 9) echo "SELECTED"; ?>>9</option>

      <option value="12" <?php if($vars['entity']->num_display == 12) echo "SELECTED"; ?>>12</option>

      <option value="15" <?php if($vars['entity']->num_display == 15) echo "SELECTED"; ?>>15</option>

      <option value="18" <?php if($vars['entity']->num_display == 18) echo "SELECTED"; ?>>18</option>

      </select>

      </p>

       

      <p>

      <form action="tidypics/bestproductaction.php" method="post">

          <?php

             $pageowner_guid = page_owner();

               //grab the user's pictures

               $images = elgg_get_entities(array(

      "type" => "object",

      "subtype" => "image",

                      "owner_guids" => "$pageowner_guid",

      "container_guid" => $guid,

      "limit" => 3,

      ));

              

              foreach ($images as $im){     

                echo "<div class='tidypics_album_cover'>";

                echo elgg_view_entity($im);

                echo "<input name='allImages[]' value='".$im->guid."' type='hidden' />";

                echo "<input name='checkedImages[]' value='".$im->guid."' type='checkbox' />";

                echo "</div>";

              } ?>

          <input type="submit"/>

      </form>

      </p>

       view.php :

      <div class="contentWrapper"> 

          <div class="tidypics_widget_latest">

              <div class="tidypics_line_break"></div>

      <?php

       

      //get the num of posts the user want to display

      $number = (int) $vars['entity']->num_display;

      //if no number has been set, default to 6

      if (!$number){

      $number = 6;

              }

              //grab the user's pictures

              $pageowner_guid = page_owner();

              $guid = $image->guid;

              $title = $image->title;

      echo elgg_view_title($title);

      echo elgg_view('output/checkboxes', array($guid));

      ?>

       </div>

      </div>

       

      bestproductaction.php :

      <?php

      $title = get_input('title');

      $guid = $_POST['checkedImages'];

       

      //create new image object

      $image = new ElggObject();

      $image->guid = $guid;

      $image->subtype = "$bestProduct";

      $image->title = $title; 

      $iamge->save();

      ?>

      Thanks in advance for any help!

Send private message

You must be logged in to send a private message.

Group membership