Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

base fork: osCommerce/oscommerce2
...
head fork: osCommerce/oscommerce2
  • 12 commits
  • 28 files changed
  • 0 commit comments
  • 4 contributors
Commits on Aug 30, 2013
Harald Ponce de Leon haraldpdl Replace mysql_* with mysqli_* for PHP 5.5 compatibility e79b9c6
Harald Ponce de Leon haraldpdl Add new partner news dashboard module ee26fa5
Harald Ponce de Leon haraldpdl Don't create empty administrator accounts (fix bug #149) 9916dc5
Harald Ponce de Leon haraldpdl * Take the catalog https path into consideration in the tep_catalog_h…
…ref_link() function

* Correctly show the language flag icon
* Fix bug #174
093dec6
Commits on Sep 01, 2013
Tóth Gergely tgely Issue #405
Close all accordions when step into admin or click oscommerce logo

Signed-off-by: Gergely <t-gely@freemail.hu>

* Replace defined icons with jQuery UI Accordion default icons
* Minor optimization
ea7422a
Tóth Gergely tgely Set languages for google modules
Signed-off-by: tgely <t-gely@freemail.hu>

Don't overwrite window.___gcfg.lang if it already exists
94c8a84
Harald Ponce de Leon haraldpdl Only include language files and module files if they exist 502184e
Commits on Sep 02, 2013
gburton gburton Canonical Product ID
Force to Integer
fb28928
gburton gburton Twitter Cards for Products
Adds Twitter Card Meta Tags to all products, note that main product
image (thumbnail) must be at least 160px by 160px.
41dfcd0
Commits on Sep 03, 2013
gburton gburton Google Adwords
Track your Adwords Conversions
fe42326
Commits on Sep 04, 2013
Harald Ponce de Leon haraldpdl Update osCommerce logo cdfeb0f
Harald Ponce de Leon haraldpdl Increase version to 2.3.3.2 43e8509
Showing with 765 additions and 76 deletions.
  1. +1 −1  catalog/admin/action_recorder.php
  2. +6 −6 catalog/admin/categories.php
  3. BIN  catalog/admin/images/oscommerce.png
  4. +4 −6 catalog/admin/includes/column_left.php
  5. +1 −0  catalog/admin/includes/configure.php
  6. +108 −21 catalog/admin/includes/functions/database.php
  7. +1 −1  catalog/admin/includes/functions/general.php
  8. +1 −1  catalog/admin/includes/functions/html_output.php
  9. +17 −0 catalog/admin/includes/languages/english/modules/dashboard/d_partner_news.php
  10. +142 −0 catalog/admin/includes/modules/dashboard/d_partner_news.php
  11. +1 −1  catalog/admin/languages.php
  12. +3 −1 catalog/admin/login.php
  13. +2 −2 catalog/admin/manufacturers.php
  14. +3 −3 catalog/admin/orders_status.php
  15. +12 −5 catalog/includes/classes/osc_template.php
  16. +100 −20 catalog/includes/functions/database.php
  17. +15 −0 catalog/includes/languages/english/modules/header_tags/ht_google_adwords_conversion.php
  18. +21 −0 catalog/includes/languages/english/modules/header_tags/ht_twitter_product_card.php
  19. +1 −1  catalog/includes/modules/action_recorder/ar_admin_login.php
  20. +1 −1  catalog/includes/modules/action_recorder/ar_contact_us.php
  21. +1 −1  catalog/includes/modules/action_recorder/ar_reset_password.php
  22. +1 −1  catalog/includes/modules/action_recorder/ar_tell_a_friend.php
  23. +1 −1  catalog/includes/modules/header_tags/ht_canonical.php
  24. +154 −0 catalog/includes/modules/header_tags/ht_google_adwords_conversion.php
  25. +125 −0 catalog/includes/modules/header_tags/ht_twitter_product_card.php
  26. +21 −1 catalog/includes/modules/social_bookmarks/sb_google_plus_one.php
  27. +21 −1 catalog/includes/modules/social_bookmarks/sb_google_plus_share.php
  28. +1 −1  catalog/includes/version.php
2  catalog/admin/action_recorder.php
View
@@ -64,7 +64,7 @@
$expired_entries += ${$HTTP_GET_VARS['module']}->expireEntries();
} else {
$delete_query = tep_db_query("delete from " . TABLE_ACTION_RECORDER . " where module = '" . tep_db_input($HTTP_GET_VARS['module']) . "'");
- $expired_entries += mysql_affected_rows($db_link);
+ $expired_entries += tep_db_affected_rows($db_link);
}
} else {
foreach ($modules_array as $module) {
12 catalog/admin/categories.php
View
@@ -531,7 +531,7 @@ function updateNet() {
?>
<tr>
<td class="main"><?php if ($i == 0) echo TEXT_PRODUCTS_NAME; ?></td>
- <td class="main"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . tep_draw_input_field('products_name[' . $languages[$i]['id'] . ']', (empty($pInfo->products_id) ? '' : tep_get_products_name($pInfo->products_id, $languages[$i]['id']))); ?></td>
+ <td class="main"><?php echo tep_image(tep_catalog_href_link(DIR_WS_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], '', 'SSL'), $languages[$i]['name']) . '&nbsp;' . tep_draw_input_field('products_name[' . $languages[$i]['id'] . ']', (empty($pInfo->products_id) ? '' : tep_get_products_name($pInfo->products_id, $languages[$i]['id']))); ?></td>
</tr>
<?php
}
@@ -564,7 +564,7 @@ function updateNet() {
<td class="main" valign="top"><?php if ($i == 0) echo TEXT_PRODUCTS_DESCRIPTION; ?></td>
<td><table border="0" cellspacing="0" cellpadding="0">
<tr>
- <td class="main" valign="top"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']); ?>&nbsp;</td>
+ <td class="main" valign="top"><?php echo tep_image(tep_catalog_href_link(DIR_WS_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], '', 'SSL'), $languages[$i]['name']); ?>&nbsp;</td>
<td class="main"><?php echo tep_draw_textarea_field('products_description[' . $languages[$i]['id'] . ']', 'soft', '70', '15', (empty($pInfo->products_id) ? '' : tep_get_products_description($pInfo->products_id, $languages[$i]['id']))); ?></td>
</tr>
</table></td>
@@ -665,7 +665,7 @@ function showPiDelConfirm(piId) {
?>
<tr>
<td class="main"><?php if ($i == 0) echo TEXT_PRODUCTS_URL . '<br /><small>' . TEXT_PRODUCTS_URL_WITHOUT_HTTP . '</small>'; ?></td>
- <td class="main"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . tep_draw_input_field('products_url[' . $languages[$i]['id'] . ']', (isset($products_url[$languages[$i]['id']]) ? stripslashes($products_url[$languages[$i]['id']]) : tep_get_products_url($pInfo->products_id, $languages[$i]['id']))); ?></td>
+ <td class="main"><?php echo tep_image(tep_catalog_href_link(DIR_WS_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], '', 'SSL'), $languages[$i]['name']) . '&nbsp;' . tep_draw_input_field('products_url[' . $languages[$i]['id'] . ']', (isset($products_url[$languages[$i]['id']]) ? stripslashes($products_url[$languages[$i]['id']]) : tep_get_products_url($pInfo->products_id, $languages[$i]['id']))); ?></td>
</tr>
<?php
}
@@ -712,7 +712,7 @@ function showPiDelConfirm(piId) {
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
- <td class="pageHeading"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . $pInfo->products_name; ?></td>
+ <td class="pageHeading"><?php echo tep_image(tep_catalog_href_link(DIR_WS_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], '', 'SSL'), $languages[$i]['name']) . '&nbsp;' . $pInfo->products_name; ?></td>
<td class="pageHeading" align="right"><?php echo $currencies->format($pInfo->products_price); ?></td>
</tr>
</table></td>
@@ -932,7 +932,7 @@ function showPiDelConfirm(piId) {
$category_inputs_string = '';
$languages = tep_get_languages();
for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
- $category_inputs_string .= '<br />' . tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . tep_draw_input_field('categories_name[' . $languages[$i]['id'] . ']');
+ $category_inputs_string .= '<br />' . tep_image(tep_catalog_href_link(DIR_WS_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], '', 'SSL'), $languages[$i]['name']) . '&nbsp;' . tep_draw_input_field('categories_name[' . $languages[$i]['id'] . ']');
}
$contents[] = array('text' => '<br />' . TEXT_CATEGORIES_NAME . $category_inputs_string);
@@ -949,7 +949,7 @@ function showPiDelConfirm(piId) {
$category_inputs_string = '';
$languages = tep_get_languages();
for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
- $category_inputs_string .= '<br />' . tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . tep_draw_input_field('categories_name[' . $languages[$i]['id'] . ']', tep_get_category_name($cInfo->categories_id, $languages[$i]['id']));
+ $category_inputs_string .= '<br />' . tep_image(tep_catalog_href_link(DIR_WS_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], '', 'SSL'), $languages[$i]['name']) . '&nbsp;' . tep_draw_input_field('categories_name[' . $languages[$i]['id'] . ']', tep_get_category_name($cInfo->categories_id, $languages[$i]['id']));
}
$contents[] = array('text' => '<br />' . TEXT_EDIT_CATEGORIES_NAME . $category_inputs_string);
BIN  catalog/admin/images/oscommerce.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 catalog/admin/includes/column_left.php
View
@@ -43,23 +43,21 @@
<script type="text/javascript">
$('#adminAppMenu').accordion({
autoHeight: false,
- icons: {
- 'header': 'ui-icon-plus',
- 'headerSelected': 'ui-icon-minus'
- }
+ collapsible: true,
<?php
$counter = 0;
foreach ($cl_box_groups as $groups) {
foreach ($groups['apps'] as $app) {
if ($app['code'] == $PHP_SELF) {
- echo ',active: ' . $counter;
- break;
+ break 2;
}
}
$counter++;
}
+
+ echo 'active: ' . (isset($app) && ($app['code'] == $PHP_SELF) ? $counter : 'false');
?>
});
1  catalog/admin/includes/configure.php
View
@@ -21,6 +21,7 @@
define('DIR_WS_ADMIN', '/admin/');
define('DIR_FS_ADMIN', DIR_FS_DOCUMENT_ROOT . DIR_WS_ADMIN);
define('DIR_WS_CATALOG', '/catalog/');
+ define('DIR_WS_HTTPS_CATALOG', '/catalog/');
define('DIR_FS_CATALOG', DIR_FS_DOCUMENT_ROOT . DIR_WS_CATALOG);
define('DIR_WS_IMAGES', 'images/');
define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
129 catalog/admin/includes/functions/database.php
View
@@ -14,12 +14,10 @@ function tep_db_connect($server = DB_SERVER, $username = DB_SERVER_USERNAME, $pa
global $$link;
if (USE_PCONNECT == 'true') {
- $$link = mysql_pconnect($server, $username, $password);
- } else {
- $$link = mysql_connect($server, $username, $password);
+ $server = 'p:' . $server;
}
- if ($$link) mysql_select_db($database);
+ $$link = mysqli_connect($server, $username, $password, $database);
return $$link;
}
@@ -27,7 +25,7 @@ function tep_db_connect($server = DB_SERVER, $username = DB_SERVER_USERNAME, $pa
function tep_db_close($link = 'db_link') {
global $$link;
- return mysql_close($$link);
+ return mysqli_close($$link);
}
function tep_db_error($query, $errno, $error) {
@@ -42,10 +40,10 @@ function tep_db_query($query, $link = 'db_link') {
$logger->write($query, 'QUERY');
}
- $result = mysql_query($query, $$link) or tep_db_error($query, mysql_errno(), mysql_error());
+ $result = mysqli_query($$link, $query) or tep_db_error($query, mysqli_errno($$link), mysqli_error($$link));
if (defined('STORE_DB_TRANSACTIONS') && (STORE_DB_TRANSACTIONS == 'true')) {
- if (mysql_error()) $logger->write(mysql_error(), 'ERROR');
+ if (mysqli_error($$link)) $logger->write(mysqli_error($llink), 'ERROR');
}
return $result;
@@ -96,33 +94,40 @@ function tep_db_perform($table, $data, $action = 'insert', $parameters = '', $li
}
function tep_db_fetch_array($db_query) {
- return mysql_fetch_array($db_query, MYSQL_ASSOC);
+ return mysqli_fetch_array($db_query, MYSQLI_ASSOC);
}
function tep_db_result($result, $row, $field = '') {
- return mysql_result($result, $row, $field);
+ if ( $field === '' ) {
+ $field = 0;
+ }
+
+ tep_db_data_seek($result, $row);
+ $data = tep_db_fetch_array($result);
+
+ return $data[$field];
}
function tep_db_num_rows($db_query) {
- return mysql_num_rows($db_query);
+ return mysqli_num_rows($db_query);
}
function tep_db_data_seek($db_query, $row_number) {
- return mysql_data_seek($db_query, $row_number);
+ return mysqli_data_seek($db_query, $row_number);
}
function tep_db_insert_id($link = 'db_link') {
global $$link;
- return mysql_insert_id($$link);
+ return mysqli_insert_id($$link);
}
function tep_db_free_result($db_query) {
- return mysql_free_result($db_query);
+ return mysqli_free_result($db_query);
}
function tep_db_fetch_fields($db_query) {
- return mysql_fetch_field($db_query);
+ return mysqli_fetch_field($db_query);
}
function tep_db_output($string) {
@@ -132,13 +137,7 @@ function tep_db_output($string) {
function tep_db_input($string, $link = 'db_link') {
global $$link;
- if (function_exists('mysql_real_escape_string')) {
- return mysql_real_escape_string($string, $$link);
- } elseif (function_exists('mysql_escape_string')) {
- return mysql_escape_string($string);
- }
-
- return addslashes($string);
+ return mysqli_real_escape_string($$link, $string);
}
function tep_db_prepare_input($string) {
@@ -154,4 +153,92 @@ function tep_db_prepare_input($string) {
return $string;
}
}
+
+ function tep_db_affected_rows($link = 'db_link') {
+ global $$link;
+
+ return mysqli_affected_rows($$link);
+ }
+
+ function tep_db_get_server_info($link = 'db_link') {
+ global $$link;
+
+ return mysqli_get_server_info($$link);
+ }
+
+ if ( !function_exists('mysqli_connect') ) {
+ define('MYSQLI_ASSOC', MYSQL_ASSOC);
+
+ function mysqli_connect($server, $username, $password, $database) {
+ if ( substr($server, 0, 2) == 'p:' ) {
+ $link = mysql_pconnect(substr($server, 2), $username, $password);
+ } else {
+ $link = mysql_connect($server, $username, $password);
+ }
+
+ if ( $link ) {
+ mysql_select_db($database, $link);
+ }
+
+ return $link;
+ }
+
+ function mysqli_close($link) {
+ return mysql_close($link);
+ }
+
+ function mysqli_query($link, $query) {
+ return mysql_query($query, $link);
+ }
+
+ function mysqli_errno($link = null) {
+ return mysql_errno($link);
+ }
+
+ function mysqli_error($link = null) {
+ return mysql_error($link);
+ }
+
+ function mysqli_fetch_array($query, $type) {
+ return mysql_fetch_array($query, $type);
+ }
+
+ function mysqli_num_rows($query) {
+ return mysql_num_rows($query);
+ }
+
+ function mysqli_data_seek($query, $offset) {
+ return mysql_data_seek($query, $offset);
+ }
+
+ function mysqli_insert_id($link) {
+ return mysql_insert_id($link);
+ }
+
+ function mysqli_free_result($query) {
+ return mysql_free_result($query);
+ }
+
+ function mysqli_fetch_field($query) {
+ return mysql_fetch_field($query);
+ }
+
+ function mysqli_real_escape_string($link, $string) {
+ if ( function_exists('mysql_real_escape_string') ) {
+ return mysql_real_escape_string($string, $link);
+ } elseif ( function_exists('mysql_escape_string') ) {
+ return mysql_escape_string($string);
+ }
+
+ return addslashes($string);
+ }
+
+ function mysqli_affected_rows($link) {
+ return mysql_affected_rows($link);
+ }
+
+ function mysqli_get_server_info($link) {
+ return mysql_get_server_info($link);
+ }
+ }
?>
2  catalog/admin/includes/functions/general.php
View
@@ -839,7 +839,7 @@ function tep_get_system_information() {
'uptime' => @exec('uptime'),
'http_server' => $HTTP_SERVER_VARS['SERVER_SOFTWARE']);
- $data['mysql'] = array('version' => (function_exists('mysql_get_server_info') ? mysql_get_server_info() : ''),
+ $data['mysql'] = array('version' => tep_db_get_server_info(),
'date' => $db['datetime']);
$data['php'] = array('version' => PHP_VERSION,
2  catalog/admin/includes/functions/html_output.php
View
@@ -45,7 +45,7 @@ function tep_catalog_href_link($page = '', $parameters = '', $connection = 'NONS
$link = HTTP_CATALOG_SERVER . DIR_WS_CATALOG;
} elseif ($connection == 'SSL') {
if (ENABLE_SSL_CATALOG == 'true') {
- $link = HTTPS_CATALOG_SERVER . DIR_WS_CATALOG;
+ $link = HTTPS_CATALOG_SERVER . (defined('DIR_WS_HTTPS_CATALOG') ? DIR_WS_HTTPS_CATALOG : DIR_WS_CATALOG);
} else {
$link = HTTP_CATALOG_SERVER . DIR_WS_CATALOG;
}
17 catalog/admin/includes/languages/english/modules/dashboard/d_partner_news.php
View
@@ -0,0 +1,17 @@
+<?php
+/*
+ $Id$
+
+ osCommerce, Open Source E-Commerce Solutions
+ http://www.oscommerce.com
+
+ Copyright (c) 2013 osCommerce
+
+ Released under the GNU General Public License
+*/
+
+define('MODULE_ADMIN_DASHBOARD_PARTNER_NEWS_TITLE', 'Partner News');
+define('MODULE_ADMIN_DASHBOARD_PARTNER_NEWS_DESCRIPTION', 'Show the lastest osCommerce Partner News');
+define('MODULE_ADMIN_DASHBOARD_PARTNER_NEWS_MORE_TITLE', 'See More Partner Services');
+define('MODULE_ADMIN_DASHBOARD_PARTNER_NEWS_ERROR_JSON_DECODE', 'PHP json_decode() function required.');
+?>
142 catalog/admin/includes/modules/dashboard/d_partner_news.php
View
@@ -0,0 +1,142 @@
+<?php
+/*
+ $Id$
+
+ osCommerce, Open Source E-Commerce Solutions
+ http://www.oscommerce.com
+
+ Copyright (c) 2013 osCommerce
+
+ Released under the GNU General Public License
+*/
+
+ class d_partner_news {
+ var $code = 'd_partner_news';
+ var $title;
+ var $description;
+ var $sort_order;
+ var $enabled = false;
+
+ function d_partner_news() {
+ $this->title = MODULE_ADMIN_DASHBOARD_PARTNER_NEWS_TITLE;
+ $this->description = MODULE_ADMIN_DASHBOARD_PARTNER_NEWS_DESCRIPTION;
+
+ if ( defined('MODULE_ADMIN_DASHBOARD_PARTNER_NEWS_STATUS') ) {
+ $this->sort_order = MODULE_ADMIN_DASHBOARD_PARTNER_NEWS_SORT_ORDER;
+ $this->enabled = (MODULE_ADMIN_DASHBOARD_PARTNER_NEWS_STATUS == 'True');
+ }
+
+ if ( !function_exists('json_decode') ) {
+ $this->description .= '<p style="color: #ff0000; font-weight: bold;">' . MODULE_ADMIN_DASHBOARD_PARTNER_NEWS_ERROR_JSON_DECODE . '</p>';
+
+ $this->enabled = false;
+ }
+ }
+
+ function getOutput() {
+ $result = $this->_getContent();
+
+ $output = null;
+
+ if (is_array($result) && !empty($result)) {
+ $output = '<table border="0" width="100%" cellspacing="0" cellpadding="4">' .
+ ' <tr class="dataTableHeadingRow">' .
+ ' <td class="dataTableHeadingContent">' . MODULE_ADMIN_DASHBOARD_PARTNER_NEWS_TITLE . '</td>' .
+ ' </tr>';
+
+ foreach ($result as $p) {
+ $output .= ' <tr class="dataTableRow" onmouseover="rowOverEffect(this);" onmouseout="rowOutEffect(this);">' .
+ ' <td class="dataTableContent"><a href="' . $p['url'] . '" target="_blank"><strong>' . $p['title'] . '</strong></a> (' . $p['category_title'] . ')<br />' . $p['status_update'] . '</td>' .
+ ' </tr>';
+ }
+
+ $output .= ' <tr class="dataTableRow">' .
+ ' <td class="dataTableContent" align="right" colspan="2"><a href="http://www.oscommerce.com/Services" target="_blank">' . MODULE_ADMIN_DASHBOARD_PARTNER_NEWS_MORE_TITLE . '</a></td>' .
+ ' </tr>' .
+ '</table>';
+ }
+
+ return $output;
+ }
+
+ function _getContent() {
+ $result = null;
+
+ $filename = DIR_FS_CACHE . 'oscommerce_partners_news.cache';
+
+ if ( file_exists($filename) ) {
+ $difference = floor((time() - filemtime($filename)) / 60);
+
+ if ( $difference < 60 ) {
+ $result = unserialize(file_get_contents($filename));
+ }
+ }
+
+ if ( !isset($result) ) {
+ if (function_exists('curl_init')) {
+ $ch = curl_init();
+ curl_setopt($ch, CURLOPT_URL, 'http://www.oscommerce.com/index.php?RPC&Website&Index&GetPartnerStatusUpdates');
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+ $response = trim(curl_exec($ch));
+ curl_close($ch);
+
+ if (!empty($response)) {
+ $result = trim($response);
+ }
+ } else {
+ if ($fp = @fsockopen('www.oscommerce.com', 80, $errno, $errstr, 30)) {
+ $header = 'GET /index.php?RPC&Website&Index&GetPartnerStatusUpdates HTTP/1.0' . "\r\n" .
+ 'Host: www.oscommerce.com' . "\r\n" .
+ 'Connection: close' . "\r\n\r\n";
+
+ fwrite($fp, $header);
+
+ $response = '';
+ while (!feof($fp)) {
+ $response .= fgets($fp, 1024);
+ }
+
+ fclose($fp);
+
+ $response = explode("\r\n\r\n", $response); // split header and content
+
+ if (isset($response[1]) && !empty($response[1])) {
+ $result = trim($response[1]);
+ }
+ }
+ }
+
+ if ( !empty($result) ) {
+ $result = json_decode($result, true);
+
+ if ( is_writable(DIR_FS_CACHE) ) {
+ file_put_contents($filename, serialize($result), LOCK_EX);
+ }
+ }
+ }
+
+ return $result;
+ }
+
+ function isEnabled() {
+ return $this->enabled;
+ }
+
+ function check() {
+ return defined('MODULE_ADMIN_DASHBOARD_PARTNER_NEWS_STATUS');
+ }
+
+ function install() {
+ tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Partner News Module', 'MODULE_ADMIN_DASHBOARD_PARTNER_NEWS_STATUS', 'True', 'Do you want to show the latest osCommerce Partner News on the dashboard?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+ tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_ADMIN_DASHBOARD_PARTNER_NEWS_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())");
+ }
+
+ function remove() {
+ tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
+ }
+
+ function keys() {
+ return array('MODULE_ADMIN_DASHBOARD_PARTNER_NEWS_STATUS', 'MODULE_ADMIN_DASHBOARD_PARTNER_NEWS_SORT_ORDER');
+ }
+ }
+?>
2  catalog/admin/languages.php
View
@@ -230,7 +230,7 @@
$contents[] = array('align' => 'center', 'text' => tep_draw_button(IMAGE_EDIT, 'document', tep_href_link(FILENAME_LANGUAGES, 'page=' . $HTTP_GET_VARS['page'] . '&lID=' . $lInfo->languages_id . '&action=edit')) . tep_draw_button(IMAGE_DELETE, 'trash', tep_href_link(FILENAME_LANGUAGES, 'page=' . $HTTP_GET_VARS['page'] . '&lID=' . $lInfo->languages_id . '&action=delete')) . tep_draw_button(IMAGE_DETAILS, 'info', tep_href_link(FILENAME_DEFINE_LANGUAGE, 'lngdir=' . $lInfo->directory)));
$contents[] = array('text' => '<br />' . TEXT_INFO_LANGUAGE_NAME . ' ' . $lInfo->name);
$contents[] = array('text' => TEXT_INFO_LANGUAGE_CODE . ' ' . $lInfo->code);
- $contents[] = array('text' => '<br />' . tep_image(DIR_WS_CATALOG_LANGUAGES . $lInfo->directory . '/images/' . $lInfo->image, $lInfo->name));
+ $contents[] = array('text' => '<br />' . tep_image(tep_catalog_href_link(DIR_WS_LANGUAGES . $lInfo->directory . '/images/' . $lInfo->image, '', 'SSL'), $lInfo->name));
$contents[] = array('text' => '<br />' . TEXT_INFO_LANGUAGE_DIRECTORY . '<br />' . DIR_WS_CATALOG_LANGUAGES . '<strong>' . $lInfo->directory . '</strong>');
$contents[] = array('text' => '<br />' . TEXT_INFO_LANGUAGE_SORT_ORDER . ' ' . $lInfo->sort_order);
}
4 catalog/admin/login.php
View
@@ -100,7 +100,9 @@
$username = tep_db_prepare_input($HTTP_POST_VARS['username']);
$password = tep_db_prepare_input($HTTP_POST_VARS['password']);
- tep_db_query("insert into " . TABLE_ADMINISTRATORS . " (user_name, user_password) values ('" . tep_db_input($username) . "', '" . tep_db_input(tep_encrypt_password($password)) . "')");
+ if ( !empty($username) ) {
+ tep_db_query("insert into " . TABLE_ADMINISTRATORS . " (user_name, user_password) values ('" . tep_db_input($username) . "', '" . tep_db_input(tep_encrypt_password($password)) . "')");
+ }
}
tep_redirect(tep_href_link(FILENAME_LOGIN));
4 catalog/admin/manufacturers.php
View
@@ -182,7 +182,7 @@
$manufacturer_inputs_string = '';
$languages = tep_get_languages();
for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
- $manufacturer_inputs_string .= '<br />' . tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . tep_draw_input_field('manufacturers_url[' . $languages[$i]['id'] . ']');
+ $manufacturer_inputs_string .= '<br />' . tep_image(tep_catalog_href_link(DIR_WS_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], '', 'SSL'), $languages[$i]['name']) . '&nbsp;' . tep_draw_input_field('manufacturers_url[' . $languages[$i]['id'] . ']');
}
$contents[] = array('text' => '<br />' . TEXT_MANUFACTURERS_URL . $manufacturer_inputs_string);
@@ -199,7 +199,7 @@
$manufacturer_inputs_string = '';
$languages = tep_get_languages();
for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
- $manufacturer_inputs_string .= '<br />' . tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . tep_draw_input_field('manufacturers_url[' . $languages[$i]['id'] . ']', tep_get_manufacturer_url($mInfo->manufacturers_id, $languages[$i]['id']));
+ $manufacturer_inputs_string .= '<br />' . tep_image(tep_catalog_href_link(DIR_WS_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], '', 'SSL'), $languages[$i]['name']) . '&nbsp;' . tep_draw_input_field('manufacturers_url[' . $languages[$i]['id'] . ']', tep_get_manufacturer_url($mInfo->manufacturers_id, $languages[$i]['id']));
}
$contents[] = array('text' => '<br />' . TEXT_MANUFACTURERS_URL . $manufacturer_inputs_string);
6 catalog/admin/orders_status.php
View
@@ -174,7 +174,7 @@
$orders_status_inputs_string = '';
$languages = tep_get_languages();
for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
- $orders_status_inputs_string .= '<br />' . tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . tep_draw_input_field('orders_status_name[' . $languages[$i]['id'] . ']');
+ $orders_status_inputs_string .= '<br />' . tep_image(tep_catalog_href_link(DIR_WS_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], '', 'SSL'), $languages[$i]['name']) . '&nbsp;' . tep_draw_input_field('orders_status_name[' . $languages[$i]['id'] . ']');
}
$contents[] = array('text' => '<br />' . TEXT_INFO_ORDERS_STATUS_NAME . $orders_status_inputs_string);
@@ -192,7 +192,7 @@
$orders_status_inputs_string = '';
$languages = tep_get_languages();
for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
- $orders_status_inputs_string .= '<br />' . tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . tep_draw_input_field('orders_status_name[' . $languages[$i]['id'] . ']', tep_get_orders_status_name($oInfo->orders_status_id, $languages[$i]['id']));
+ $orders_status_inputs_string .= '<br />' . tep_image(tep_catalog_href_link(DIR_WS_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], '', 'SSL'), $languages[$i]['name']) . '&nbsp;' . tep_draw_input_field('orders_status_name[' . $languages[$i]['id'] . ']', tep_get_orders_status_name($oInfo->orders_status_id, $languages[$i]['id']));
}
$contents[] = array('text' => '<br />' . TEXT_INFO_ORDERS_STATUS_NAME . $orders_status_inputs_string);
@@ -218,7 +218,7 @@
$orders_status_inputs_string = '';
$languages = tep_get_languages();
for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
- $orders_status_inputs_string .= '<br />' . tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . tep_get_orders_status_name($oInfo->orders_status_id, $languages[$i]['id']);
+ $orders_status_inputs_string .= '<br />' . tep_image(tep_catalog_href_link(DIR_WS_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], '', 'SSL'), $languages[$i]['name']) . '&nbsp;' . tep_get_orders_status_name($oInfo->orders_status_id, $languages[$i]['id']);
}
$contents[] = array('text' => $orders_status_inputs_string);
17 catalog/includes/classes/osc_template.php
View
@@ -83,14 +83,21 @@ function buildBlocks() {
$class = substr($module, 0, strrpos($module, '.'));
if ( !class_exists($class) ) {
- include(DIR_WS_LANGUAGES . $language . '/modules/' . $group . '/' . $module);
- include(DIR_WS_MODULES . $group . '/' . $class . '.php');
+ if ( file_exists(DIR_WS_LANGUAGES . $language . '/modules/' . $group . '/' . $module) ) {
+ include(DIR_WS_LANGUAGES . $language . '/modules/' . $group . '/' . $module);
+ }
+
+ if ( file_exists(DIR_WS_MODULES . $group . '/' . $class . '.php') ) {
+ include(DIR_WS_MODULES . $group . '/' . $class . '.php');
+ }
}
- $mb = new $class();
+ if ( class_exists($class) ) {
+ $mb = new $class();
- if ( $mb->isEnabled() ) {
- $mb->execute();
+ if ( $mb->isEnabled() ) {
+ $mb->execute();
+ }
}
}
}
120 catalog/includes/functions/database.php
View
@@ -14,12 +14,10 @@ function tep_db_connect($server = DB_SERVER, $username = DB_SERVER_USERNAME, $pa
global $$link;
if (USE_PCONNECT == 'true') {
- $$link = mysql_pconnect($server, $username, $password);
- } else {
- $$link = mysql_connect($server, $username, $password);
+ $server = 'p:' . $server;
}
- if ($$link) mysql_select_db($database);
+ $$link = mysqli_connect($server, $username, $password, $database);
return $$link;
}
@@ -27,7 +25,7 @@ function tep_db_connect($server = DB_SERVER, $username = DB_SERVER_USERNAME, $pa
function tep_db_close($link = 'db_link') {
global $$link;
- return mysql_close($$link);
+ return mysqli_close($$link);
}
function tep_db_error($query, $errno, $error) {
@@ -41,10 +39,10 @@ function tep_db_query($query, $link = 'db_link') {
error_log('QUERY ' . $query . "\n", 3, STORE_PAGE_PARSE_TIME_LOG);
}
- $result = mysql_query($query, $$link) or tep_db_error($query, mysql_errno(), mysql_error());
+ $result = mysqli_query($$link, $query) or tep_db_error($query, mysqli_errno($$link), mysqli_error($$link));
if (defined('STORE_DB_TRANSACTIONS') && (STORE_DB_TRANSACTIONS == 'true')) {
- $result_error = mysql_error();
+ $result_error = mysqli_error($$link);
error_log('RESULT ' . $result . ' ' . $result_error . "\n", 3, STORE_PAGE_PARSE_TIME_LOG);
}
@@ -96,29 +94,29 @@ function tep_db_perform($table, $data, $action = 'insert', $parameters = '', $li
}
function tep_db_fetch_array($db_query) {
- return mysql_fetch_array($db_query, MYSQL_ASSOC);
+ return mysqli_fetch_array($db_query, MYSQLI_ASSOC);
}
function tep_db_num_rows($db_query) {
- return mysql_num_rows($db_query);
+ return mysqli_num_rows($db_query);
}
function tep_db_data_seek($db_query, $row_number) {
- return mysql_data_seek($db_query, $row_number);
+ return mysqli_data_seek($db_query, $row_number);
}
function tep_db_insert_id($link = 'db_link') {
global $$link;
- return mysql_insert_id($$link);
+ return mysqli_insert_id($$link);
}
function tep_db_free_result($db_query) {
- return mysql_free_result($db_query);
+ return mysqli_free_result($db_query);
}
function tep_db_fetch_fields($db_query) {
- return mysql_fetch_field($db_query);
+ return mysqli_fetch_field($db_query);
}
function tep_db_output($string) {
@@ -128,13 +126,7 @@ function tep_db_output($string) {
function tep_db_input($string, $link = 'db_link') {
global $$link;
- if (function_exists('mysql_real_escape_string')) {
- return mysql_real_escape_string($string, $$link);
- } elseif (function_exists('mysql_escape_string')) {
- return mysql_escape_string($string);
- }
-
- return addslashes($string);
+ return mysqli_real_escape_string($$link, $string);
}
function tep_db_prepare_input($string) {
@@ -150,4 +142,92 @@ function tep_db_prepare_input($string) {
return $string;
}
}
+
+ function tep_db_affected_rows($link = 'db_link') {
+ global $$link;
+
+ return mysqli_affected_rows($$link);
+ }
+
+ function tep_db_get_server_info($link = 'db_link') {
+ global $$link;
+
+ return mysqli_get_server_info($$link);
+ }
+
+ if ( !function_exists('mysqli_connect') ) {
+ define('MYSQLI_ASSOC', MYSQL_ASSOC);
+
+ function mysqli_connect($server, $username, $password, $database) {
+ if ( substr($server, 0, 2) == 'p:' ) {
+ $link = mysql_pconnect(substr($server, 2), $username, $password);
+ } else {
+ $link = mysql_connect($server, $username, $password);
+ }
+
+ if ( $link ) {
+ mysql_select_db($database, $link);
+ }
+
+ return $link;
+ }
+
+ function mysqli_close($link) {
+ return mysql_close($link);
+ }
+
+ function mysqli_query($link, $query) {
+ return mysql_query($query, $link);
+ }
+
+ function mysqli_errno($link = null) {
+ return mysql_errno($link);
+ }
+
+ function mysqli_error($link = null) {
+ return mysql_error($link);
+ }
+
+ function mysqli_fetch_array($query, $type) {
+ return mysql_fetch_array($query, $type);
+ }
+
+ function mysqli_num_rows($query) {
+ return mysql_num_rows($query);
+ }
+
+ function mysqli_data_seek($query, $offset) {
+ return mysql_data_seek($query, $offset);
+ }
+
+ function mysqli_insert_id($link) {
+ return mysql_insert_id($link);
+ }
+
+ function mysqli_free_result($query) {
+ return mysql_free_result($query);
+ }
+
+ function mysqli_fetch_field($query) {
+ return mysql_fetch_field($query);
+ }
+
+ function mysqli_real_escape_string($link, $string) {
+ if ( function_exists('mysql_real_escape_string') ) {
+ return mysql_real_escape_string($string, $link);
+ } elseif ( function_exists('mysql_escape_string') ) {
+ return mysql_escape_string($string);
+ }
+
+ return addslashes($string);
+ }
+
+ function mysqli_affected_rows($link) {
+ return mysql_affected_rows($link);
+ }
+
+ function mysqli_get_server_info($link) {
+ return mysql_get_server_info($link);
+ }
+ }
?>
15 catalog/includes/languages/english/modules/header_tags/ht_google_adwords_conversion.php
View
@@ -0,0 +1,15 @@
+<?php
+/*
+ $Id$
+
+ osCommerce, Open Source E-Commerce Solutions
+ http://www.oscommerce.com
+
+ Copyright (c) 2013 osCommerce
+
+ Released under the GNU General Public License
+*/
+
+ define('MODULE_HEADER_TAGS_GOOGLE_ADWORDS_CONVERSION_TITLE', 'Google AdWords Conversion Tracking');
+ define('MODULE_HEADER_TAGS_GOOGLE_ADWORDS_CONVERSION_DESCRIPTION', 'Add Google AdWords Conversion Tracking to the Checkout Success page');
+?>
21 catalog/includes/languages/english/modules/header_tags/ht_twitter_product_card.php
View
@@ -0,0 +1,21 @@
+<?php
+/*
+ $Id$
+
+ osCommerce, Open Source E-Commerce Solutions
+ http://www.oscommerce.com
+
+ Copyright (c) 2013 osCommerce
+
+ Released under the GNU General Public License
+*/
+
+ define('MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_TITLE', 'Twitter Product Card');
+ define('MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_DESCRIPTION', 'Add Twitter Product Card tags to your product information pages.');
+
+ define('MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_TEXT_PRE_ORDER', 'Pre-Order');
+ define('MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_TEXT_IN_STOCK', 'In Stock');
+ define('MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_TEXT_OUT_OF_STOCK', 'Out of Stock');
+ define('MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_TEXT_BUY_NOW', 'BUY NOW');
+ define('MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_TEXT_CONTACT_US', 'CONTACT US');
+?>
2  catalog/includes/modules/action_recorder/ar_admin_login.php
View
@@ -47,7 +47,7 @@ function expireEntries() {
tep_db_query("delete from " . TABLE_ACTION_RECORDER . " where module = '" . $this->code . "' and date_added < date_sub(now(), interval " . (int)$this->minutes . " minute)");
- return mysql_affected_rows($db_link);
+ return tep_db_affected_rows($db_link);
}
function check() {
2  catalog/includes/modules/action_recorder/ar_contact_us.php
View
@@ -45,7 +45,7 @@ function expireEntries() {
tep_db_query("delete from " . TABLE_ACTION_RECORDER . " where module = '" . $this->code . "' and date_added < date_sub(now(), interval " . (int)$this->minutes . " minute)");
- return mysql_affected_rows($db_link);
+ return tep_db_affected_rows($db_link);
}
function check() {
2  catalog/includes/modules/action_recorder/ar_reset_password.php
View
@@ -47,7 +47,7 @@ function expireEntries() {
tep_db_query("delete from " . TABLE_ACTION_RECORDER . " where module = '" . $this->code . "' and date_added < date_sub(now(), interval " . (int)$this->minutes . " minute)");
- return mysql_affected_rows($db_link);
+ return tep_db_affected_rows($db_link);
}
function check() {
2  catalog/includes/modules/action_recorder/ar_tell_a_friend.php
View
@@ -45,7 +45,7 @@ function expireEntries() {
tep_db_query("delete from " . TABLE_ACTION_RECORDER . " where module = '" . $this->code . "' and date_added < date_sub(now(), interval " . (int)$this->minutes . " minute)");
- return mysql_affected_rows($db_link);
+ return tep_db_affected_rows($db_link);
}
function check() {
2  catalog/includes/modules/header_tags/ht_canonical.php
View
@@ -32,7 +32,7 @@ function execute() {
global $PHP_SELF, $HTTP_GET_VARS, $cPath, $oscTemplate;
if (basename($PHP_SELF) == FILENAME_PRODUCT_INFO) {
- $oscTemplate->addBlock('<link rel="canonical" href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id'], 'NONSSL', false) . '" />' . "\n", $this->group);
+ $oscTemplate->addBlock('<link rel="canonical" href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . (int)$HTTP_GET_VARS['products_id'], 'NONSSL', false) . '" />' . "\n", $this->group);
} elseif (basename($PHP_SELF) == FILENAME_DEFAULT) {
if (isset($cPath) && tep_not_null($cPath)) {
$oscTemplate->addBlock('<link rel="canonical" href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=' . $cPath, 'NONSSL', false) . '" />' . "\n", $this->group);
154 catalog/includes/modules/header_tags/ht_google_adwords_conversion.php
View
@@ -0,0 +1,154 @@
+<?php
+/*
+ $Id$
+
+ osCommerce, Open Source E-Commerce Solutions
+ http://www.oscommerce.com
+
+ Copyright (c) 2013 osCommerce
+
+ Released under the GNU General Public License
+*/
+
+ class ht_google_adwords_conversion {
+ var $code = 'ht_google_adwords_conversion';
+ var $group = 'footer_scripts';
+ var $title;
+ var $description;
+ var $sort_order;
+ var $enabled = false;
+
+ function ht_google_adwords_conversion() {
+ $this->title = MODULE_HEADER_TAGS_GOOGLE_ADWORDS_CONVERSION_TITLE;
+ $this->description = MODULE_HEADER_TAGS_GOOGLE_ADWORDS_CONVERSION_DESCRIPTION;
+
+ if ( defined('MODULE_HEADER_TAGS_GOOGLE_ADWORDS_CONVERSION_STATUS') ) {
+ $this->sort_order = MODULE_HEADER_TAGS_GOOGLE_ADWORDS_CONVERSION_SORT_ORDER;
+ $this->enabled = (MODULE_HEADER_TAGS_GOOGLE_ADWORDS_CONVERSION_STATUS == 'True');
+ }
+ }
+
+ function execute() {
+ global $PHP_SELF, $oscTemplate, $customer_id, $lng, $languages_id;
+
+ if (MODULE_HEADER_TAGS_GOOGLE_ADWORDS_CONVERSION_JS_PLACEMENT != 'Footer') {
+ $this->group = 'header_tags';
+ }
+
+ if ( ($PHP_SELF == FILENAME_CHECKOUT_SUCCESS) && tep_session_is_registered('customer_id') ) {
+ $order_query = tep_db_query("select orders_id, currency, currency_value from " . TABLE_ORDERS . " where customers_id = '" . (int)$customer_id . "' order by date_purchased desc limit 1");
+
+ if (tep_db_num_rows($order_query) == 1) {
+ $order = tep_db_fetch_array($order_query);
+
+ $order_subtotal_query = tep_db_query("select value from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$order['orders_id'] . "' and class='ot_subtotal'");
+ $order_subtotal = tep_db_fetch_array($order_subtotal_query);
+
+ if (!isset($lng) || (isset($lng) && !is_object($lng))) {
+ include(DIR_WS_CLASSES . 'language.php');
+ $lng = new language;
+ }
+
+ $language_code = 'en';
+
+ foreach ($lng->catalog_languages as $lkey => $lvalue) {
+ if ($lvalue['id'] == $languages_id) {
+ $language_code = $lkey;
+ break;
+ }
+ }
+
+ $conversion_id = (int)MODULE_HEADER_TAGS_GOOGLE_ADWORDS_CONVERSION_ID;
+ $conversion_language = tep_output_string_protected($language_code);
+ $conversion_format = (int)MODULE_HEADER_TAGS_GOOGLE_ADWORDS_CONVERSION_FORMAT;
+ $conversion_color = tep_output_string_protected(MODULE_HEADER_TAGS_GOOGLE_ADWORDS_CONVERSION_COLOR);
+ $conversion_label = tep_output_string_protected(MODULE_HEADER_TAGS_GOOGLE_ADWORDS_CONVERSION_LABEL);
+ $conversion_value = $this->format_raw($order_subtotal['value'], $order['currency'], $order['currency_value']);
+
+ $output = <<<EOD
+<script type="text/javascript">
+/* <![CDATA[ */
+var google_conversion_id = {$conversion_id};
+var google_conversion_language = "{$conversion_language}";
+var google_conversion_format = "{$conversion_format}";
+var google_conversion_color = "{$conversion_color}";
+var google_conversion_label = "{$conversion_label}";
+var google_conversion_value = {$conversion_value};
+/* ]]> */
+</script>
+<script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js"></script>
+<noscript>
+<div style="display:inline;">
+<img height="1" width="1" style="border-style:none;" alt="" src="//www.googleadservices.com/pagead/conversion/{$conversion_id}/?value={$conversion_value}&amp;label={$conversion_label}&amp;guid=ON&amp;script=0"/>
+</div>
+</noscript>
+EOD;
+
+ $oscTemplate->addBlock($output, $this->group);
+ }
+ }
+ }
+
+ function format_raw($number, $currency_code = '', $currency_value = '') {
+ global $currencies, $currency;
+
+ if (empty($currency_code) || !$currencies->is_set($currency_code)) {
+ $currency_code = $currency;
+ }
+
+ if (empty($currency_value) || !is_numeric($currency_value)) {
+ $currency_value = $currencies->currencies[$currency_code]['value'];
+ }
+
+ return number_format(tep_round($number * $currency_value, $currencies->currencies[$currency_code]['decimal_places']), $currencies->currencies[$currency_code]['decimal_places'], '.', '');
+ }
+
+ function isEnabled() {
+ return $this->enabled;
+ }
+
+ function check() {
+ return defined('MODULE_HEADER_TAGS_GOOGLE_ADWORDS_CONVERSION_STATUS');
+ }
+
+ function install() {
+ tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Google AdWords Conversion Module', 'MODULE_HEADER_TAGS_GOOGLE_ADWORDS_CONVERSION_STATUS', 'True', 'Do you want to allow the Google AdWords Conversion Module on your checkout success page?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+ tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Conversion ID', 'MODULE_HEADER_TAGS_GOOGLE_ADWORDS_CONVERSION_ID', '', 'The Google AdWords Conversion ID', '6', '0', now())");
+ tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Tracking Notification Layout', 'MODULE_HEADER_TAGS_GOOGLE_ADWORDS_CONVERSION_FORMAT', '1', 'A small message will appear on your site telling customers that their visits on your site are being tracked. We recommend you use it.', '6', '0', 'tep_cfg_google_adwords_conversion_set_format(', 'tep_cfg_google_adwords_conversion_get_format', now())");
+ tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Page Background Color', 'MODULE_HEADER_TAGS_GOOGLE_ADWORDS_CONVERSION_COLOR', 'ffffff', 'Enter a HTML color to match the color of your website background page.', '6', '0', now())");
+ tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Conversion Label', 'MODULE_HEADER_TAGS_GOOGLE_ADWORDS_CONVERSION_LABEL', '', 'The alphanumeric code generated by Google for your AdWords Conversion', '6', '0', now())");
+ tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Javascript Placement', 'MODULE_HEADER_TAGS_GOOGLE_ADWORDS_CONVERSION_JS_PLACEMENT', 'Footer', 'Should the Google AdWords Conversion javascript be loaded in the header or footer?', '6', '1', 'tep_cfg_select_option(array(\'Header\', \'Footer\'), ', now())");
+ tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_HEADER_TAGS_GOOGLE_ADWORDS_CONVERSION_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())");
+ }
+
+ function remove() {
+ tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
+ }
+
+ function keys() {
+ return array('MODULE_HEADER_TAGS_GOOGLE_ADWORDS_CONVERSION_STATUS', 'MODULE_HEADER_TAGS_GOOGLE_ADWORDS_CONVERSION_ID', 'MODULE_HEADER_TAGS_GOOGLE_ADWORDS_CONVERSION_FORMAT', 'MODULE_HEADER_TAGS_GOOGLE_ADWORDS_CONVERSION_COLOR', 'MODULE_HEADER_TAGS_GOOGLE_ADWORDS_CONVERSION_LABEL', 'MODULE_HEADER_TAGS_GOOGLE_ADWORDS_CONVERSION_JS_PLACEMENT', 'MODULE_HEADER_TAGS_GOOGLE_ADWORDS_CONVERSION_SORT_ORDER');
+ }
+ }
+
+ function tep_cfg_google_adwords_conversion_set_format($key_value, $field_key) {
+ $format = array('1' => 'Single Line', '2' => 'Two Lines', '3' => 'No Indicator');
+
+ $string = '';
+
+ foreach ( $format as $key => $value ) {
+ $string .= '<br /><input type="radio" name="configuration[' . $field_key . ']" value="' . $key . '"';
+
+ if ($key_value == $key) $string .= ' checked="checked"';
+
+ $string .= ' /> ' . $value;
+ }
+
+ return $string;
+ }
+
+ function tep_cfg_google_adwords_conversion_get_format($value) {
+ $format = array('1' => 'Single Line', '2' => 'Two Lines', '3' => 'No Indicator');
+
+ return $format[$value];
+ }
+?>
125 catalog/includes/modules/header_tags/ht_twitter_product_card.php
View
@@ -0,0 +1,125 @@
+<?php
+/*
+ $Id$
+
+ osCommerce, Open Source E-Commerce Solutions
+ http://www.oscommerce.com
+
+ Copyright (c) 2013 osCommerce
+
+ Released under the GNU General Public License
+*/
+
+ class ht_twitter_product_card {
+ var $code = 'ht_twitter_product_card';
+ var $group = 'header_tags';
+ var $title;
+ var $description;
+ var $sort_order;
+ var $enabled = false;
+
+ function ht_twitter_product_card() {
+ $this->title = MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_TITLE;
+ $this->description = MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_DESCRIPTION;
+
+ if ( defined('MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_STATUS') ) {
+ $this->sort_order = MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_SORT_ORDER;
+ $this->enabled = (MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_STATUS == 'True');
+ }
+ }
+
+ function execute() {
+ global $PHP_SELF, $HTTP_GET_VARS, $oscTemplate, $languages_id, $currencies, $currency;
+
+ if ( ($PHP_SELF == FILENAME_PRODUCT_INFO) && isset($HTTP_GET_VARS['products_id']) ) {
+ $product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_image, p.products_price, p.products_quantity, p.products_tax_class_id, p.products_date_available from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");
+
+ if ( tep_db_num_rows($product_info_query) === 1 ) {
+ $product_info = tep_db_fetch_array($product_info_query);
+
+ $data = array('card' => 'product',
+ 'title' => $product_info['products_name']);
+
+ if ( tep_not_null(MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_SITE_ID) ) {
+ $data['site'] = MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_SITE_ID;
+ }
+
+ if ( tep_not_null(MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_USER_ID) ) {
+ $data['creator'] = MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_USER_ID;
+ }
+
+ $product_description = substr(trim(preg_replace('/\s\s+/', ' ', strip_tags($product_info['products_description']))), 0, 197);
+
+ if ( strlen($product_description) == 197 ) {
+ $product_description .= ' ..';
+ }
+
+ $data['description'] = $product_description;
+
+ $products_image = $product_info['products_image'];
+
+ $pi_query = tep_db_query("select image from " . TABLE_PRODUCTS_IMAGES . " where products_id = '" . (int)$product_info['products_id'] . "' order by sort_order limit 1");
+
+ if ( tep_db_num_rows($pi_query) === 1 ) {
+ $pi = tep_db_fetch_array($pi_query);
+
+ $products_image = $pi['image'];
+ }
+
+ $data['image:src'] = tep_href_link(DIR_WS_IMAGES . $products_image, '', 'NONSSL', false, false);
+
+ if ($new_price = tep_get_products_special_price($product_info['products_id'])) {
+ $products_price = $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id']));
+ } else {
+ $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
+ }
+
+ $data['data1'] = $products_price;
+ $data['label1'] = $currency;
+
+ if ( $product_info['products_date_available'] > date('Y-m-d H:i:s') ) {
+ $data['data2'] = MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_TEXT_PRE_ORDER;
+ $data['label2'] = tep_date_short($product_info['products_date_available']);
+ } elseif ( $product_info['products_quantity'] > 0 ) {
+ $data['data2'] = MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_TEXT_IN_STOCK;
+ $data['label2'] = MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_TEXT_BUY_NOW;
+ } else {
+ $data['data2'] = MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_TEXT_OUT_OF_STOCK;
+ $data['label2'] = MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_TEXT_CONTACT_US;
+ }
+
+ $result = '';
+
+ foreach ( $data as $key => $value ) {
+ $result .= '<meta name="twitter:' . tep_output_string_protected($key) . '" content="' . tep_output_string_protected($value) . '" />' . "\n";
+ }
+
+ $oscTemplate->addBlock($result, $this->group);
+ }
+ }
+ }
+
+ function isEnabled() {
+ return $this->enabled;
+ }
+
+ function check() {
+ return defined('MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_STATUS');
+ }
+
+ function install() {
+ tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Twitter Product Card Module', 'MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_STATUS', 'True', 'Do you want to allow Twitter Product Card tags to be added to your product information pages? Note that your product images MUST be at least 160px by 160px.', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+ tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Twitter Author @username', 'MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_USER_ID', '', 'Your @username at Twitter', '6', '0', now())");
+ tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Twitter Shop @username', 'MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_SITE_ID', '', 'Your shops @username at Twitter (or leave blank if it is the same as your @username above).', '6', '0', now())");
+ tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())");
+ }
+
+ function remove() {
+ tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
+ }
+
+ function keys() {
+ return array('MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_STATUS', 'MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_USER_ID', 'MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_SITE_ID', 'MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_SORT_ORDER');
+ }
+ }
+?>
22 catalog/includes/modules/social_bookmarks/sb_google_plus_one.php
View
@@ -30,7 +30,19 @@ function sb_google_plus_one() {
}
function getOutput() {
- global $HTTP_GET_VARS;
+ global $HTTP_GET_VARS, $lng, $languages_id;
+
+ if (!isset($lng) || (isset($lng) && !is_object($lng))) {
+ include(DIR_WS_CLASSES . 'language.php');
+ $lng = new language;
+ }
+
+ foreach ($lng->catalog_languages as $lkey => $lvalue) {
+ if ($lvalue['id'] == $languages_id) {
+ $language_code = $lkey;
+ break;
+ }
+ }
$output = '<div class="g-plusone" data-href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id'], 'NONSSL', false) . '" data-size="' . strtolower(MODULE_SOCIAL_BOOKMARKS_GOOGLE_PLUS_ONE_SIZE) . '" data-annotation="' . strtolower(MODULE_SOCIAL_BOOKMARKS_GOOGLE_PLUS_ONE_ANNOTATION) . '"';
@@ -41,6 +53,14 @@ function getOutput() {
$output .= '></div>';
$output .= '<script type="text/javascript">
+ if ( typeof window.___gcfg == "undefined" ) {
+ window.___gcfg = { };
+ }
+
+ if ( typeof window.___gcfg.lang == "undefined" ) {
+ window.___gcfg.lang = "' . tep_output_string_protected($language_code) . '";
+ }
+
(function() {
var po = document.createElement(\'script\'); po.type = \'text/javascript\'; po.async = true;
po.src = \'https://apis.google.com/js/plusone.js\';
22 catalog/includes/modules/social_bookmarks/sb_google_plus_share.php
View
@@ -30,7 +30,19 @@ function sb_google_plus_share() {
}
function getOutput() {
- global $HTTP_GET_VARS;
+ global $HTTP_GET_VARS, $lng, $languages_id;
+
+ if (!isset($lng) || (isset($lng) && !is_object($lng))) {
+ include(DIR_WS_CLASSES . 'language.php');
+ $lng = new language;
+ }
+
+ foreach ($lng->catalog_languages as $lkey => $lvalue) {
+ if ($lvalue['id'] == $languages_id) {
+ $language_code = $lkey;
+ break;
+ }
+ }
$button_height = (int)MODULE_SOCIAL_BOOKMARKS_GOOGLE_PLUS_SHARE_HEIGHT;
@@ -47,6 +59,14 @@ function getOutput() {
$output .= ' data-height="' . $button_height . '" data-align="' . strtolower(MODULE_SOCIAL_BOOKMARKS_GOOGLE_PLUS_SHARE_ALIGN) . '"></div>';
$output .= '<script type="text/javascript">
+ if ( typeof window.___gcfg == "undefined" ) {
+ window.___gcfg = { };
+ }
+
+ if ( typeof window.___gcfg.lang == "undefined" ) {
+ window.___gcfg.lang = "' . tep_output_string_protected($language_code) . '";
+ }
+
(function() {
var po = document.createElement(\'script\'); po.type = \'text/javascript\'; po.async = true;
po.src = \'https://apis.google.com/js/plusone.js\';
2  catalog/includes/version.php
View
@@ -1 +1 @@
-2.3.3.1
+2.3.3.2

No commit comments for this range

Something went wrong with that request. Please try again.