source: extensions/piwigopress/PiwigoPress_options.php @ 14974

Last change on this file since 14974 was 4125, checked in by vdigital, 14 years ago

[PiwigoPress] = 1.04 =

  • Alternate pwg_get_contents (file_get_contents, fsockopen, ...)
  • cURL is coming soon
  • Property svn:eol-style set to LF
  • Property svn:keywords set to Author Date Id Revision
File size: 8.1 KB
Line 
1<?php
2if (defined('PHPWG_ROOT_PATH')) return; /* Avoid direct usage under Piwigo */
3if (!defined('PWGP_NAME')) return; /* Avoid unpredicted access */
4
5        // Defaults
6        $gallery = wp_parse_args( (array) $gallery, array('title'=>__('Random picture'), 
7                'thumbnail'=>'true', 'piwigo'=>'piwigo', 'external'=>'', 'number'=>1, 'category'=>0, 'from'=> 12, 'divclass'=>'', 
8                'class'=>'',  'most_visited' => 'true', 'best_rated' => 'true',
9                'most_commented' => 'true', 'random' => 'true', 'recent_pics' => 'true',
10                'calendar' => 'true', 'tags' => 'true', 'comments' => 'true', 'mbcategories' => 'true',
11                 ) );
12
13        $title = htmlspecialchars($gallery['title']);
14        $thumbnail = (htmlspecialchars($gallery['thumbnail']) == 'true') ? 'checked="checked"':'';
15        $piwigo = htmlspecialchars($gallery['piwigo']);
16        $external = htmlspecialchars($gallery['external']);
17        $number = intval($gallery['number']);
18        $category = intval($gallery['category']);
19        $from = intval($gallery['from']);
20        $divclass = htmlspecialchars($gallery['divclass']);
21        $class = htmlspecialchars($gallery['class']);
22        $mbcategories = (htmlspecialchars($gallery['mbcategories']) == 'true') ? 'checked="checked"':'';
23        $most_visited = (htmlspecialchars($gallery['most_visited']) == 'true') ? 'checked="checked"':'';
24        $best_rated = (htmlspecialchars($gallery['best_rated']) == 'true') ? 'checked="checked"':'';
25        $most_commented = (htmlspecialchars($gallery['most_commented']) == 'true') ? 'checked="checked"':'';
26        $random = (htmlspecialchars($gallery['random']) == 'true') ? 'checked="checked"':'';
27        $recent_pics = (htmlspecialchars($gallery['recent_pics']) == 'true') ? 'checked="checked"':'';
28        $calendar = (htmlspecialchars($gallery['calendar']) == 'true') ? 'checked="checked"':'';
29        $tags = (htmlspecialchars($gallery['tags']) == 'true') ? 'checked="checked"':'';
30        $comments = (htmlspecialchars($gallery['comments']) == 'true') ? 'checked="checked"':'';
31
32        // Options
33        echo '<p style="text-align:right;"><label for="' . $this->get_field_name('title') . '">' . __('Title','pwg') 
34        . ' <input style="width: 250px;" id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title')
35        . '" type="text" value="' . $title . '" /></label></p>';
36        // Thumbnail
37        echo '<p style="text-align:right;"><label for="' . $this->get_field_name('thumbnail') . '">' . __('Get thumbnails','pwg') 
38        . ' <input style="width: 50px;" id="' . $this->get_field_id('thumbnail') . '" name="' . $this->get_field_name('thumbnail')
39        . '" type="checkbox" value="true" ' . $thumbnail . '/></label></p>';
40        // Piwigo directory
41        echo '<p style="text-align:right;"><label for="' . $this->get_field_name('piwigo') . '">' . __('<strong>Local</strong> directory (if local)','pwg') 
42        . ' <input style="width: 200px;" id="' . $this->get_field_id('piwigo') . '" name="' . $this->get_field_name('piwigo')
43        . '" type="text" value="' . $piwigo . '" /></label></p>';
44        // External website
45        echo '<p style="text-align:right;"><label for="' . $this->get_field_name('external') . '">' . __('(or) <strong>External</strong> gallery URL','pwg') 
46        . ' <input style="width: 250px;" id="' . $this->get_field_id('external') . '" name="' . $this->get_field_name('external')
47        . '" type="text" value="' . $external . '" /></label></p>';
48        // number of pictures
49        echo '<p style="text-align:right;"><label for="' . $this->get_field_name('number') . '">' . __('Number of pictures (0=none)','pwg') 
50        . ' <input style="width: 30px;" id="' . $this->get_field_id('number') . '" name="' . $this->get_field_name('number')
51        . '" type="text" value="' . $number . '" /></label></p>';
52        // Optional parameters
53        echo '<h5>' . __('Optional parameters','pwg') . '</h5>';
54        // Selected category
55        echo '<p style="text-align:right; font-size:8px; margin:0;"><label for="' . $this->get_field_name('category') . '">' . __('Category id (0=all)','pwg') 
56        . ' <input style="width: 30px;" id="' . $this->get_field_id('category') . '" name="' . $this->get_field_name('category')
57        . '" type="text" value="' . $category . '" /></label></p>';
58        // from
59        echo '<p style="text-align:right; font-size:8px; margin:0;"><label for="' . $this->get_field_name('from') . '">' . __('Since X months (0=all)','pwg') 
60        . ' <input style="width: 30px;" id="' . $this->get_field_id('from') . '" name="' . $this->get_field_name('from')
61        . '" type="text" value="' . $from . '" /></label></p>';
62        // divclass
63        echo '<p style="text-align:right; font-size:8px; margin:0;"><label for="' . $this->get_field_name('divclass') . '">' . __('CSS DIV class','pwg') 
64        . ' <input style="width: 200px;" id="' . $this->get_field_id('divclass') . '" name="' . $this->get_field_name('divclass')
65        . '" type="text" value="' . $divclass . '" /></label></p>';
66        // class
67        echo '<p style="text-align:right; font-size:8px; margin:0;"><label for="' . $this->get_field_name('class') . '">' . __('CSS IMG class','pwg') 
68        . ' <input style="width: 200px;" id="' . $this->get_field_id('class') . '" name="' . $this->get_field_name('class')
69        . '" type="text" value="' . $class . '" /></label></p>';
70
71        // The categories menu
72        echo '<table><tr><td style="text-align:right; font-size:8px;" colspan="2"><label for="' . $this->get_field_name('mbcategories') . '">' . __('Categories menu','pwg') 
73        . ' <input style="width: 50px;" id="' . $this->get_field_id('mbcategories') . '" name="' . $this->get_field_name('mbcategories')
74        . '" type="checkbox" value="true" ' . $mbcategories . '/></label></td>';
75        // The most visited
76        echo '</tr><tr><td style="text-align:right; font-size:8px;"><label for="' . $this->get_field_name('most_visited') . '">' . __('Most visited','pwg') 
77        . ' <input style="width: 50px;" id="' . $this->get_field_id('most_visited') . '" name="' . $this->get_field_name('most_visited')
78        . '" type="checkbox" value="true" ' . $most_visited . '/></label></td>';
79        // The best rated
80        echo '<td style="text-align:right; font-size:8px;"><label for="' . $this->get_field_name('best_rated') . '">' . __('Best rated','pwg') 
81        . ' <input style="width: 50px;" id="' . $this->get_field_id('best_rated') . '" name="' . $this->get_field_name('best_rated')
82        . '" type="checkbox" value="true" ' . $best_rated . '/></label></td>';
83        // The most commented
84        echo '</tr><tr><td style="text-align:right; font-size:8px;"><label for="' . $this->get_field_name('most_commented') . '">' . __('Most commented','pwg') 
85        . ' <input style="width: 50px;" id="' . $this->get_field_id('most_commented') . '" name="' . $this->get_field_name('most_commented')
86        . '" type="checkbox" value="true" ' . $most_commented . '/></label></td>';
87        // The random link
88        echo '<td style="text-align:right; font-size:8px;"><label for="' . $this->get_field_name('random') . '">' . __('Random','pwg') 
89        . ' <input style="width: 50px;" id="' . $this->get_field_id('random') . '" name="' . $this->get_field_name('random')
90        . '" type="checkbox" value="true" ' . $random . '/></label></td>';
91        // The recent pics
92        echo '</tr><tr><td style="text-align:right; font-size:8px;"><label for="' . $this->get_field_name('recent_pics') . '">' . __('Recent pics','pwg') 
93        . ' <input style="width: 50px;" id="' . $this->get_field_id('recent_pics') . '" name="' . $this->get_field_name('recent_pics')
94        . '" type="checkbox" value="true" ' . $recent_pics . '/></label></td>';
95        // The calendar
96        echo '<td style="text-align:right; font-size:8px;"><label for="' . $this->get_field_name('calendar') . '">' . __('Calendar','pwg') 
97        . ' <input style="width: 50px;" id="' . $this->get_field_id('calendar') . '" name="' . $this->get_field_name('calendar','pwg')
98        . '" type="checkbox" value="true" ' . $calendar . '/></label></td>';
99        // The random
100        echo '</tr><tr><td style="text-align:right; font-size:8px;"><label for="' . $this->get_field_name('tags') . '">' . __('Tags','pwg') 
101        . ' <input style="width: 50px;" id="' . $this->get_field_id('tags') . '" name="' . $this->get_field_name('tags')
102        . '" type="checkbox" value="true" ' . $random . '/></label></td>';
103        // The tags
104        echo '<td style="text-align:right; font-size:8px;"><label for="' . $this->get_field_name('comments') . '">' . __('Comments','pwg') 
105        . ' <input style="width: 50px;" id="' . $this->get_field_id('comments') . '" name="' . $this->get_field_name('comments','pwg')
106        . '" type="checkbox" value="true" ' . $tags . '/></label></td></tr></table>';
107
108?>
Note: See TracBrowser for help on using the repository browser.