e107help.org Q&A
0 like 0 dislike

hi,

i have created a plugin for write a sequence of excursion.

and i have a text and images link archived in mysql

and my file excursion.php is

[code]

<?php
require_once("../../class2.php");


require_once(HEADERF);                     // render the header (everything before the main content area)


$ns->tablerender("","<div class='col-xs-12 top20'></div>

");

    $sql = e107::getDb();
    if($allRows = $sql->retrieve('escursioni', 'escursioni_categoria, escursioni_image,
escursioni_immaginetitle, escursioni_title, escursioni_text, escursioni_spectecniche, escursioni_organizzatore, escursioni_emailorganizzatore, escursioni_organizzatore, escursioni_date, escursioni_sitoweb', 'escursioni_active=1 ORDER BY escursioni_id DESC', true))
 {
        foreach($allRows as $row)
        {
            echo "
<div class='row'>
<div class='col-xs-4'><h3>" . $row["escursioni_categoria"]."</h3></div>
<div class='col-xs-4'>" . $row["escursioni_immaginetitle"]."</div>
<div class='col-xs-4 pull-right'>" . $row["escursioni_image"]."</div>

// i show in webpage this -->   {e_MEDIA_IMAGE}2015-10/mulino_trekking.jpg

// and not the image

<div class='col-xs-4'>".$tp->toDate($row["escursioni_date"])."</div>
<div class='col-xs-8 pull-right'>".$row["escursioni_spectechniche"]."</div>
<div class='col-xs-12'><h3>".$row["escursioni_title"]."</h3></div>
<div class='col-xs-12'>". $row["escursioni_text"]."</div>
<div class='col-xs-6'>".$row["escursioni_organizzatore"]."</div>
<div class='col-xs-6'>".$row["escursioni_emailorganizzatore"]."</div>
<div class='col-xs-12'>".$row["escursioni_sitoweb"]."</div>
</div>";  
 }
    }

    require_once(FOOTERF);

    exit;

?>

[/code]

 

Can you helop me for view a image and not only link archived on dbmysql??

i know this code but i dont know the way for integrate on my script and view a image?

    • url = "{e_MEDIA_IMAGE}2012-04/someimage.jpg";
    • $image = $tp->thumbUrl($url);
    • echo "<img src='".$image."' />";
e107 version v2
closed
in Plugins by (355 points) 11 27 27

1 Answer

0 like 0 dislike
Best answer

<?php
require_once("../../class2.php");


require_once(HEADERF);                     // render the header (everything before the main content area)


$ns->tablerender("","<div class='col-xs-12 top20'></div>

");

    $sql = e107::getDb();
    if($allRows = $sql->retrieve('escursioni', 'escursioni_categoria, escursioni_image,
escursioni_immaginetitle, escursioni_title, escursioni_text, escursioni_spectecniche, escursioni_organizzatore, escursioni_emailorganizzatore, escursioni_organizzatore, escursioni_date, escursioni_sitoweb', 'escursioni_active=1 ORDER BY escursioni_id DESC', true))
 {
        foreach($allRows as $row)
        {

$imageUrl = $row['escursioni_image'];   // could just be $url

$image = $tp->thumbUrl($imageUrl);


            echo "
<div class='row'>
<div class='col-xs-4'><h3>" . $row["escursioni_categoria"]."</h3></div>
<div class='col-xs-4'>" . $row["escursioni_immaginetitle"]."</div>

<div class='col-xs-4 pull-right'><img src='".$image."' /></div>


//<div class='col-xs-4 pull-right'>" . $row["escursioni_image"]."</div>

// i show in webpage this -->   {e_MEDIA_IMAGE}2015-10/mulino_trekking.jpg

// and not the image

<div class='col-xs-4'>".$tp->toDate($row["escursioni_date"])."</div>
<div class='col-xs-8 pull-right'>".$row["escursioni_spectechniche"]."</div>
<div class='col-xs-12'><h3>".$row["escursioni_title"]."</h3></div>
<div class='col-xs-12'>". $row["escursioni_text"]."</div>
<div class='col-xs-6'>".$row["escursioni_organizzatore"]."</div>
<div class='col-xs-6'>".$row["escursioni_emailorganizzatore"]."</div>
<div class='col-xs-12'>".$row["escursioni_sitoweb"]."</div>
</div>";  
 }
    }

    require_once(FOOTERF);

    exit;

?>

by (459 points) 17 37 50
selected by
You want to make the images displayed in a drop down menu?

If you are using the admin_config.php that is generated by the plugin maker or what?
no i dont want insert the image in a dropdown menu, but the category result in new field "dropdownmenu" for example: field_category: content1; content2; content3; content4; newfield_selectcategory: dropdownmenu with all record field_category :)

So like a link dropdown menu?

In my admin_config.php for my plugin is like this:

// In the class my_plugin_ui extends e_admin_ui

protected $fields         = array (  'checkboxes' =>   array ( 'title' => '', 'type' => null, 'data' => null, 'width' => '5%', 'thclass' => 'center', 'forced' => '1', 'class' => 'center', 'toggle' => 'e-multiselect',  ),
          'voice_type' =>   array ( 'title' => LAN_VOI_TYPE, 'type' => 'dropdown', 'tab' => 0, 'data' => 'int', 'width' => 'auto', 'filter' => true, 'inline' => true, 'help' => LAN_VOI_INFO_ST, 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left',  ),

// Below are the values - voice_type is in the database

        public function init()
        {
            // Set drop-down values (if any).
            $this->fields['voice_type']['writeParms'] = array(LAN_VOI_SELECT, LAN_VOI_TYPE_MUM, LAN_VOI_TYPE_TS3, LAN_VOI_TYPE_VEN); // Example Drop-down array.

}

// Above - I use LAN file for the dropdown menu options

Again idk if that is what you are looking for or not

 

thank you....! perfect
996 questions
1,389 answers
2,527 comments
2,512 users