Changeset 4216
- Timestamp:
- Nov 5, 2009, 11:15:41 PM (14 years ago)
- Location:
- extensions/piwigopress
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/piwigopress/PiwigoPress_code.php
r4125 r4216 65 65 echo '<ul style="clear: both;"><li>' . __('Pictures categories','pwg') . '<ul>'; 66 66 foreach ($cats["result"]["categories"] as $cat) { 67 echo '<li><a title="' . $cat['name'] . '" href="' . $piwigo_url . 'index.php?category/' . $cat['id'] . '">' . $cat['name'] . '</a></li>' ;67 echo '<li><a title="' . $cat['name'] . '" href="' . $piwigo_url . 'index.php?category/' . $cat['id'] . '">' . $cat['name'] . '</a></li>'."\r\n"; 68 68 } 69 echo '</ul></li></ul>' ;69 echo '</ul></li></ul>'."\r\n"; 70 70 } 71 71 } … … 76 76 77 77 if ($most_visited == 'true') 78 echo '<li><a title="' . __('Most visited','pwg') . '" href="' . $piwigo_url . 'index.php?most_visited' . '">' . __('Most visited','pwg') . '</a></li>' ;78 echo '<li><a title="' . __('Most visited','pwg') . '" href="' . $piwigo_url . 'index.php?most_visited' . '">' . __('Most visited','pwg') . '</a></li>'."\r\n"; 79 79 80 80 if ($best_rated == 'true') 81 echo '<li><a title="' . __('Best rated','pwg') . '" href="' . $piwigo_url . 'index.php?best_rated' . '">' . __('Best rated','pwg') . '</a></li>' ;81 echo '<li><a title="' . __('Best rated','pwg') . '" href="' . $piwigo_url . 'index.php?best_rated' . '">' . __('Best rated','pwg') . '</a></li>'."\r\n"; 82 82 83 83 if ($most_commented == 'true') 84 echo '<li><a title="' . __('Most commented','pwg') . '" href="' . $piwigo_url . 'index.php?most_commented' . '">' . __('Most commented','pwg') . '</a></li>' ;84 echo '<li><a title="' . __('Most commented','pwg') . '" href="' . $piwigo_url . 'index.php?most_commented' . '">' . __('Most commented','pwg') . '</a></li>'."\r\n"; 85 85 86 86 if ($random == 'true') 87 echo '<li><a title="' . __('Random','pwg') . '" href="' . $piwigo_url . 'random.php' . '">' . __('Random','pwg') . '</a></li>' ;87 echo '<li><a title="' . __('Random','pwg') . '" href="' . $piwigo_url . 'random.php' . '">' . __('Random','pwg') . '</a></li>'."\r\n"; 88 88 89 89 if ($recent_pics == 'true') 90 echo '<li><a title="' . __('Recent pics','pwg') . '" href="' . $piwigo_url . 'index.php?recent_pics' . '">' . __('Recent pics','pwg') . '</a></li>' ;90 echo '<li><a title="' . __('Recent pics','pwg') . '" href="' . $piwigo_url . 'index.php?recent_pics' . '">' . __('Recent pics','pwg') . '</a></li>'."\r\n"; 91 91 92 92 if ($calendar == 'true') 93 echo '<li><a title="' . __('Calendar','pwg') . '" href="' . $piwigo_url . 'index.php?created-monthly-calendar' . '">' . __('Calendar','pwg') . '</a></li>' ;93 echo '<li><a title="' . __('Calendar','pwg') . '" href="' . $piwigo_url . 'index.php?created-monthly-calendar' . '">' . __('Calendar','pwg') . '</a></li>'."\r\n"; 94 94 95 95 if ($tags == 'true') 96 echo '<li><a title="' . __('Tags','pwg') . '" href="' . $piwigo_url . 'tags.php' . '">' . __('Tags','pwg') . '</a></li>' ;96 echo '<li><a title="' . __('Tags','pwg') . '" href="' . $piwigo_url . 'tags.php' . '">' . __('Tags','pwg') . '</a></li>'."\r\n"; 97 97 98 98 if ($comments == 'true') 99 echo '<li><a title="' . __('Comments','pwg') . '" href="' . $piwigo_url . 'comments.php' . '">' . __('Comments','pwg') . '</a></li>' ;99 echo '<li><a title="' . __('Comments','pwg') . '" href="' . $piwigo_url . 'comments.php' . '">' . __('Comments','pwg') . '</a></li>'."\r\n"; 100 100 101 101 102 102 if ($most_visited == 'true' or $best_rated == 'true' or 103 103 $most_commented == 'true' or $random == 'true' or $recent_pics == 'true' or 104 $calendar == 'true' or $tags == 'true' or $comments == 'true') echo '</ul>' ;104 $calendar == 'true' or $tags == 'true' or $comments == 'true') echo '</ul>'."\r\n"; 105 105 106 106 echo $after_widget; -
extensions/piwigopress/PiwigoPress_get.php
r4125 r4216 19 19 $pwg_prev_host = $host; 20 20 $mode = $pwg_mode; 21 // $mode = 'ch'; // Forcing a test '' all, 'fs' fsockopen, 'ch' cURL21 // $mode = 'ch'; // Forcing a test '' all, 'fs' fsockopen, 'ch' cURL 22 22 23 23 // 1 - The simplest solution: file_get_contents … … 34 34 } 35 35 if ( $mode == '' ) $mode = 'fs'; 36 if ( $pwg_mode == '' ) $pwg_mode = 'fs'; 36 if ( $pwg_mode == '' ) $pwg_mode = 'fs'; // Remind it 37 37 // 2 - Often accepted access: fsockopen 38 38 if ($mode == 'fs') { … … 56 56 } 57 57 } 58 $return["stat"] = 'failed';59 $pwg_mode = 'failed';60 return serialize($return);61 58 62 // Not active cURL right now 63 if ( $pwg_mode == 'fs' ) $pwg_mode = 'ch'; 59 if ( $pwg_mode == 'fs' ) $pwg_mode = 'ch'; // Remind it 64 60 // 3 - Sometime another solution: curl_exec 65 61 // See http://fr2.php.net/manual/en/curl.installation.php 66 62 if (function_exists('curl_init') and $pwg_mode == 'ch') { 67 63 $ch = @curl_init(); 64 @curl_setopt($ch, CURLOPT_URL, $url); 65 @curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); 68 66 @curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); 69 @curl_setopt($ch, CURLOPT_URL, $url);70 67 @curl_setopt($ch, CURLOPT_HEADER, 1); 71 68 @curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0'); … … 76 73 $status = @curl_getinfo($ch, CURLINFO_HTTP_CODE); 77 74 @curl_close($value); 78 if ($value !== false and $status >= 200 and $status < 400) 79 $value = substr($value, $header_length); 75 if ($value !== false and $status >= 200 and $status < 400) { 76 $value = substr($value, $header_length); 77 // echo '<br/>-ch- ('. $value . ') <br/>'; 78 return $value; 79 } 80 else $pwg_mode = 'failed'; // Sorry but remind it as well 80 81 } 81 82 82 83 // No other solutions 83 84 $return["stat"] = 'failed'; 84 echo '<br/>- pwg_get_contents: failed on file_get, fsockopen and cURL processes<br/>'; 85 $pwg_mode = 'failed'; 85 // echo '<br/>- pwg_get_contents: failed on file_get, fsockopen and cURL processes<br/>'; 86 86 return serialize($return); 87 87 } -
extensions/piwigopress/piwigopress.php
r4125 r4216 73 73 register_widget('PiwigoPress'); 74 74 } 75 76 // Add gallery pictures 77 function PiwigoPress_media_buttons() { 78 } 75 79 add_action('widgets_init', PWGP_NAME . '_Init'); 80 add_action('media_buttons', PWGP_NAME . '_media_buttons'); 76 81 ?> -
extensions/piwigopress/readme.txt
r4129 r4216 68 68 == Frequently Asked Questions == 69 69 70 Currently, none. 70 No thumbnail are displayed. 71 Since (12) months and no public pictures since July 2005): Try 99 or 0 months! 72 Class CSS includes a display: none; Check your css! 73 Private Category instead of public; Check the selected category! 74 75 Category (0) since (0) months and correct CSS class, then check: 76 - Locked Gallery 77 - Mandatory subscription 78 - All private categories 79 - All locked categories 80 - Picture privacy level (> 0 : must be 0 ---) 81 82 83 84 Example of Class: 85 .img-shadow { 86 float:left; 87 background: url(images/shadowAlpha.png) no-repeat bottom right !important; 88 background: url(images/shadow.gif) no-repeat bottom right; 89 margin: 10px 0 0 10px !important; 90 margin: 10px 0 0 5px; 91 } 92 93 .img-shadow img { 94 display: block; 95 position: relative; 96 background-color: #fff; 97 border: 1px solid #a9a9a9; 98 margin: -6px 6px 6px -6px; 99 padding: 4px; 100 } 101 102 Will be included in future releases: 103 http://www.vdigital.org/sharing/wp-content/themes/green-apples/images/shadowAlpha.png 104 http://www.vdigital.org/sharing/wp-content/themes/green-apples/images/shadow.gif 71 105 72 106 = A question that someone might have = … … 81 115 82 116 == Changelog == 117 118 = 1.05 = 119 * Alternate pwg_get_contents (cURL) 83 120 84 121 = 1.04 =
Note: See TracChangeset
for help on using the changeset viewer.