Changeset 1664483
- Timestamp:
- 05/25/2017 04:57:37 AM (9 years ago)
- Location:
- wp-portfolio
- Files:
-
- 60 added
- 2 edited
-
tags/1.42.2 (added)
-
tags/1.42.2/cache (added)
-
tags/1.42.2/columns.css (added)
-
tags/1.42.2/frontend.css (added)
-
tags/1.42.2/imgs (added)
-
tags/1.42.2/imgs/ajax-loader.gif (added)
-
tags/1.42.2/imgs/icon_cross.png (added)
-
tags/1.42.2/imgs/icon_stop.png (added)
-
tags/1.42.2/imgs/icon_tick.png (added)
-
tags/1.42.2/imgs/thumbnail_invalid_api_access_details_lg.jpg (added)
-
tags/1.42.2/imgs/thumbnail_invalid_api_access_details_sm.jpg (added)
-
tags/1.42.2/imgs/thumbnail_invalid_api_access_details_xlg.jpg (added)
-
tags/1.42.2/imgs/thumbnail_invalid_api_access_details_xxlg.jpg (added)
-
tags/1.42.2/imgs/thumbnail_lock_to_account_lg.jpg (added)
-
tags/1.42.2/imgs/thumbnail_lock_to_account_sm.jpg (added)
-
tags/1.42.2/imgs/thumbnail_lock_to_account_xlg.jpg (added)
-
tags/1.42.2/imgs/thumbnail_lock_to_account_xxlg.jpg (added)
-
tags/1.42.2/imgs/thumbnail_other_error_lg.jpg (added)
-
tags/1.42.2/imgs/thumbnail_other_error_sm.jpg (added)
-
tags/1.42.2/imgs/thumbnail_other_error_xlg.jpg (added)
-
tags/1.42.2/imgs/thumbnail_other_error_xxlg.jpg (added)
-
tags/1.42.2/imgs/thumbnail_queued_lg.jpg (added)
-
tags/1.42.2/imgs/thumbnail_queued_sm.jpg (added)
-
tags/1.42.2/imgs/thumbnail_queued_xlg.jpg (added)
-
tags/1.42.2/imgs/thumbnail_queued_xxlg.jpg (added)
-
tags/1.42.2/imgs/thumbnail_unknown_host_lg.jpg (added)
-
tags/1.42.2/imgs/thumbnail_unknown_host_sm.jpg (added)
-
tags/1.42.2/imgs/thumbnail_unknown_host_xlg.jpg (added)
-
tags/1.42.2/imgs/thumbnail_unknown_host_xxlg.jpg (added)
-
tags/1.42.2/imgs/thumbnail_upgrade_account_feature_lg.jpg (added)
-
tags/1.42.2/imgs/thumbnail_upgrade_account_feature_sm.jpg (added)
-
tags/1.42.2/imgs/thumbnail_upgrade_account_feature_xlg.jpg (added)
-
tags/1.42.2/imgs/thumbnail_upgrade_account_feature_xxlg.jpg (added)
-
tags/1.42.2/imgs/thumbnail_upgrade_account_lg.jpg (added)
-
tags/1.42.2/imgs/thumbnail_upgrade_account_sm.jpg (added)
-
tags/1.42.2/imgs/thumbnail_upgrade_account_xlg.jpg (added)
-
tags/1.42.2/imgs/thumbnail_upgrade_account_xxlg.jpg (added)
-
tags/1.42.2/imgs/wpp-tinymce-button-icon.png (added)
-
tags/1.42.2/js (added)
-
tags/1.42.2/js/wpp-admin.js (added)
-
tags/1.42.2/js/wpp-simplebox.init.js (added)
-
tags/1.42.2/js/wpp-simplebox.min.js (added)
-
tags/1.42.2/js/wpp-tinymce-plugin.js (added)
-
tags/1.42.2/languages (added)
-
tags/1.42.2/languages/wp-portfolio.pot (added)
-
tags/1.42.2/lib (added)
-
tags/1.42.2/lib/admin_only.inc.php (added)
-
tags/1.42.2/lib/thumbnailer.inc.php (added)
-
tags/1.42.2/lib/utils.inc.php (added)
-
tags/1.42.2/lib/widget.inc.php (added)
-
tags/1.42.2/portfolio.css (added)
-
tags/1.42.2/readme.txt (added)
-
tags/1.42.2/simplebox.min.css (added)
-
tags/1.42.2/wp-portfolio-tinymce-translation.php (added)
-
tags/1.42.2/wp-portfolio.php (added)
-
tags/1.42.2/wplib (added)
-
tags/1.42.2/wplib/utils_formbuilder.inc.php (added)
-
tags/1.42.2/wplib/utils_pagebuilder.inc.php (added)
-
tags/1.42.2/wplib/utils_sql.inc.php (added)
-
tags/1.42.2/wplib/utils_tablebuilder.inc.php (added)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/wp-portfolio.php (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-portfolio/trunk/readme.txt
r1661269 r1664483 4 4 Requires at least: 4.3.0 5 5 Tested up to: 4.7.4 6 Stable tag: 1.42. 16 Stable tag: 1.42.2 7 7 8 8 … … 93 93 == Changelog == 94 94 95 = 1.42.2 = 96 * BUG FIX: SQL error when portfolio shortcode embedded in widget using random sort AND having listings that exist in multiple groups (output only contains these sites once; not repeated) 97 95 98 = 1.42.1 = 96 99 * BUG FIX: Needed to show Custom Thumbnail Scaling options regardless of "STW Rendering Type" … … 98 101 * BUG FIX: Double slash after "cache" in the path to the file from the cache 99 102 * BUG FIX: Incorrect use of the "Custom Thumbnail Scale Method" option value when generating a file name in the cache 103 * New Feature: More support for create/delete custom directory pages for "Directory Support" 104 * NOTE: Change in behavior for new installs ("Directory Support" output of custom directory pages is DISABLED, by default, now) 100 105 101 106 = 1.42 = -
wp-portfolio/trunk/wp-portfolio.php
r1660775 r1664483 4 4 * Plugin URI: http://wordpress.org/extend/plugins/wp-portfolio/ 5 5 * Description: A plugin that allows you to show off your portfolio through a single page on your WordPress website with automatically generated thumbnails. To show your portfolio, create a new page and paste [wp-portfolio] into it. The plugin requires you to have a free account with <a href="https://shrinktheweb.com/">Shrink The Web</a> to generate the thumbnails. 6 * Version: 1.42. 16 * Version: 1.42.2 7 7 * Text Domain: wp-portfolio 8 8 * Domain Path: /languages … … 39 39 40 40 /** Constant: The current version of the database needed by this version of the plugin. */ 41 define('WPP_VERSION', '1.42. 1');41 define('WPP_VERSION', '1.42.2'); 42 42 43 43 … … 1031 1031 $WHERE_CLAUSE .= 'WHERE (siteactive = 1)'; 1032 1032 1033 $GROUPBYCLAUSE = $isWidgetTemplate ? "GROUP BY $websites_table.siteid" : ''; 1034 1033 1035 $ORDERBY_ORDERING = ''; 1034 1036 if ( ! $orderAscending ) { … … 1055 1057 1056 1058 $WHERE_CLAUSE .= ' ' . (!empty($selectedGroups) ? "AND $groups_websites_table.group_id IN ('" . implode("','", $selectedGroups) . "')" 1057 : "AND 0=1");1059 : "AND 0=1"); 1058 1060 } 1059 1061 … … 1064 1066 ON $groups_table.groupid = $groups_websites_table.group_id 1065 1067 $WHERE_CLAUSE 1068 $GROUPBYCLAUSE 1066 1069 $ORDERBY_CLAUSE 1067 1070 "; … … 1187 1190 1188 1191 $message = false; 1189 if ($groups && is_array($selectedGroups)) { 1190 if (!is_array($not_empty_groups)) { 1191 $not_empty_groups = array(); 1192 foreach ($websites as $website) { 1193 if (!empty($website->groupid) && !in_array($website->groupid, $not_empty_groups)) { 1194 $not_empty_groups[] = $website->groupid; 1192 if (!$isWidgetTemplate) { 1193 if ($groups && is_array($selectedGroups)) { 1194 if (!is_array($not_empty_groups)) { 1195 $not_empty_groups = array(); 1196 foreach ($websites as $website) { 1197 if (!empty($website->groupid) && !in_array($website->groupid, $not_empty_groups)) { 1198 $not_empty_groups[] = $website->groupid; 1199 } 1195 1200 } 1196 1201 } 1202 $empty_groups = array_diff($selectedGroups, $not_empty_groups); 1203 if (!empty($empty_groups) && is_array($empty_groups)) { 1204 $message = sprintf('<p>' . __('Portfolio websites in groups with such IDs (%s) does not exist.', 'wp-portfolio') . '</p>', implode(',', $empty_groups)); 1205 } 1206 } elseif (empty($websites)) { 1207 $message = '<p>' . __('There are no portfolio websites.', 'wp-portfolio') . '</p>'; 1197 1208 } 1198 $empty_groups = array_diff($selectedGroups, $not_empty_groups);1199 if (!empty($empty_groups) && is_array($empty_groups)) {1200 $message = sprintf('<p>' . __('Portfolio websites in groups with such IDs (%s) does not exist.', 'wp-portfolio') . '</p>', implode(',', $empty_groups));1201 }1202 }1203 elseif (empty($websites)) {1204 $message = '<p>' . __('There are no portfolio websites.', 'wp-portfolio') . '</p>';1205 1209 } 1206 1210 … … 1295 1299 $websites_table = $wpdb->prefix . TABLE_WEBSITES; 1296 1300 $groups_table = $wpdb->prefix . TABLE_WEBSITE_GROUPS; 1301 $groups_websites_table = $wpdb->prefix . TABLE_GROUPS_WEBSITES; 1297 1302 1298 1303 // Validate the count is a number 1299 1304 $count = $count + 0; 1300 1305 1301 // Determine if we only want to get websites from certain groups 1302 $WHERE_CLAUSE = ""; 1303 if ($groups) 1304 { 1305 $selectedGroups = explode(",", $groups); 1306 foreach ($selectedGroups as $possibleGroup) 1307 { 1308 // Some matches might be empty strings 1309 if ($possibleGroup > 0) { 1310 $WHERE_CLAUSE .= "$groups_table.groupid = '$possibleGroup' OR "; 1306 // Determine if we only want to show certain groups 1307 $WHERE_CLAUSE = ''; 1308 1309 // Add initial where if needed 1310 $WHERE_CLAUSE .= 'WHERE (siteactive = 1)'; 1311 1312 $selectedGroups = false; 1313 $not_empty_groups = false; 1314 if ($groups) { 1315 $selectedGroups = is_array($selectedGroups = explode(',', $groups)) ? array_unique($selectedGroups) : array(); 1316 foreach ($selectedGroups as $key => $selectedGroupID) { 1317 if (!is_numeric($selectedGroupID)) { 1318 unset($selectedGroups[$key]); 1311 1319 } 1312 1320 } 1313 } // end of if ($groups) 1314 1315 // Add initial where if needed 1316 if ($WHERE_CLAUSE) 1317 { 1318 // Remove last OR to maintain valid SQL 1319 if (substr($WHERE_CLAUSE, -4) == ' OR ') { 1320 $WHERE_CLAUSE = substr($WHERE_CLAUSE, 0, strlen($WHERE_CLAUSE)-4); 1321 } 1322 1323 $WHERE_CLAUSE = "WHERE siteactive != '0' AND (". $WHERE_CLAUSE . ")"; 1324 } 1325 // Always hide inactive sites 1326 else { 1327 $WHERE_CLAUSE = "WHERE siteactive != '0'"; 1328 } 1329 1321 1322 $WHERE_CLAUSE .= ' ' . (!empty($selectedGroups) ? "AND $groups_websites_table.group_id IN ('" . implode("','", $selectedGroups) . "')" 1323 : "AND 0=1"); 1324 } 1330 1325 1331 1326 // Limit the number of websites if requested … … 1335 1330 } 1336 1331 1332 $GROUPBYCLAUSE = $isWidgetTemplate ? "GROUP BY $websites_table.siteid" : ''; 1337 1333 1338 1334 // Get website details, merge with group details 1339 $SQL = "SELECT * FROM $websites_table 1340 LEFT JOIN $groups_table ON $websites_table.sitegroup = $groups_table.groupid 1341 $WHERE_CLAUSE 1342 ORDER BY RAND() 1343 $LIMITCLAUSE 1344 "; 1335 $SQL = "SELECT $websites_table.*, $groups_table.* FROM $websites_table 1336 RIGHT JOIN $groups_websites_table 1337 ON $groups_websites_table.website_id=$websites_table.siteid 1338 LEFT JOIN $groups_table 1339 ON $groups_table.groupid = $groups_websites_table.group_id 1340 $WHERE_CLAUSE 1341 $GROUPBYCLAUSE 1342 ORDER BY RAND() 1343 $LIMITCLAUSE 1344 "; 1345 1345 1346 1346 $wpdb->show_errors(); 1347 1347 $websites = $wpdb->get_results($SQL, OBJECT); 1348 1349 $message = false; 1350 if (!$isWidgetTemplate) { 1351 if ($groups && is_array($selectedGroups)) { 1352 if (!is_array($not_empty_groups)) { 1353 $not_empty_groups = array(); 1354 foreach ($websites as $website) { 1355 if (!empty($website->groupid) && !in_array($website->groupid, $not_empty_groups)) { 1356 $not_empty_groups[] = $website->groupid; 1357 } 1358 } 1359 } 1360 $empty_groups = array_diff($selectedGroups, $not_empty_groups); 1361 if (!empty($empty_groups) && is_array($empty_groups)) { 1362 $message = sprintf('<p>' . __('Portfolio websites in groups with such IDs (%s) does not exist.', 'wp-portfolio') . '</p>', implode(',', $empty_groups)); 1363 } 1364 } elseif (empty($websites)) { 1365 $message = '<p>' . __('There are no portfolio websites.', 'wp-portfolio') . '</p>'; 1366 } 1367 } 1348 1368 1349 1369 // Get the current list of custom data fields … … 1377 1397 1378 1398 // Render websites into HTML. Use blank group to avoid rendering group details. 1379 $portfolioHTML = WPPortfolio_renderPortfolio($websites, $template_website, ' ', false, $isWidgetTemplate, $columns, false);1399 $portfolioHTML = WPPortfolio_renderPortfolio($websites, $template_website, ' ', false, $isWidgetTemplate, $columns, $message); 1380 1400 1381 1401 return $portfolioHTML;
Note: See TracChangeset
for help on using the changeset viewer.