Browse files

Some small edits for plugins system

  • Loading branch information...
1 parent d1202aa commit c0c28948061470f6a77c9b7da23bc1139ed969ff @MightyGorgon committed May 15, 2011
View
3 trunk/activity/ip_root/plugins/activity/activity_gambling.php
@@ -303,7 +303,8 @@
$exists = $db->sql_fetchrow($r);
if (!$exists['user_id'])
{
- message_die(GENERAL_ERROR, $lang['No_such_user'], $lang['error']);
+ if (!defined('STATUS_404')) define('STATUS_404', true);
+ message_die(GENERAL_ERROR, $lang['NO_USER'], $lang['error']);
}
else
{
View
2 trunk/activity/ip_root/plugins/activity/includes/functions_amod_plus.php
@@ -189,7 +189,7 @@ function send_challenge_pm($dest_user, $subject, $message)
if (!$result)
{
$error = true;
- $error_msg = $lang['No_such_user'];
+ $error_msg = $lang['NO_USER'];
}
$to_userdata = $db->sql_fetchrow($result);
View
7 trunk/activity/ip_root/plugins/activity/info.php
@@ -15,13 +15,6 @@
$plugin_details = array();
-$lang_file = dirname(__FILE__) . '/language/lang_' . $config['default_lang'] . '/lang_info.' . PHP_EXT;
-if (!file_exists($lang_file))
-{
- $lang_file = dirname(__FILE__) . '/language/lang_english/lang_info.' . PHP_EXT;
-}
-@include($lang_file);
-
// Please note that config name will be prefixed with plugin_
$plugin_details['config'] = 'activity';
$plugin_details['name'] = $lang['PLUGIN_ACTIVITY'];
View
7 trunk/cash/ip_root/plugins/cash/info.php
@@ -15,13 +15,6 @@
$plugin_details = array();
-$lang_file = dirname(__FILE__) . '/language/lang_' . $config['default_lang'] . '/lang_info.' . PHP_EXT;
-if (!file_exists($lang_file))
-{
- $lang_file = dirname(__FILE__) . '/language/lang_english/lang_info.' . PHP_EXT;
-}
-@include($lang_file);
-
// Please note that config name will be prefixed with plugin_
$plugin_details['config'] = 'cash';
$plugin_details['name'] = $lang['PLUGIN_CASH'];
View
7 trunk/downloads/ip_root/plugins/downloads/info.php
@@ -15,13 +15,6 @@
$plugin_details = array();
-$lang_file = dirname(__FILE__) . '/language/lang_' . $config['default_lang'] . '/lang_info.' . PHP_EXT;
-if (!file_exists($lang_file))
-{
- $lang_file = dirname(__FILE__) . '/language/lang_english/lang_info.' . PHP_EXT;
-}
-@include($lang_file);
-
// Please note that config name will be prefixed with plugin_
$plugin_details['config'] = 'downloads';
$plugin_details['name'] = $lang['PLUGIN_DOWNLOADS'];
View
4 trunk/guestbooks/ip_root/blocks/plugin_guestbook.php
@@ -161,10 +161,10 @@ function cms_plugin_guestbook_form()
if ($post_moderation_allowed)
{
$edit_link = append_sid($ip_root_path . CMS_PAGE_GUESTBOOK . '?' . $post_append_url . '&mode=input&action=edit');
- $edit_img = '<a href="' . $edit_link . '"><img src="' . $ip_root_path . 'images/cms/b_edit.png" alt="' . $lang['EDIT'] . '" title="' . $lang['EDIT'] . '" /></a>';
+ $edit_img = '<a href="' . $edit_link . '"><img src="' . $ip_root_path . $images['cms_icon_edit'] . '" alt="' . $lang['EDIT'] . '" title="' . $lang['EDIT'] . '" /></a>';
$delete_link = append_sid($ip_root_path . CMS_PAGE_GUESTBOOK . '?' . $post_append_url . '&amp;mode=delete');
- $delete_img = '<a href="' . $delete_link . '"><img src="' . $ip_root_path . 'images/cms/b_delete.png" alt="' . $lang['DELETE'] . '" title="' . $lang['DELETE'] . '" /></a>';
+ $delete_img = '<a href="' . $delete_link . '"><img src="' . $ip_root_path . $images['cms_icon_delete'] . '" alt="' . $lang['DELETE'] . '" title="' . $lang['DELETE'] . '" /></a>';
}
$class = ($i % 2) ? $theme['td_class1'] : $theme['td_class2'];
View
4 trunk/guestbooks/ip_root/plugins/guestbooks/guestbook.php
@@ -376,10 +376,10 @@
if ($post_moderation_allowed)
{
$edit_link = append_sid(THIS_FILE . '?' . $post_append_url . '&amp;mode=input&amp;action=edit');
- $edit_img = '<a href="' . $edit_link . '"><img src="' . IP_ROOT_PATH . 'images/cms/b_edit.png" alt="' . $lang['EDIT'] . '" title="' . $lang['EDIT'] . '" /></a>';
+ $edit_img = '<a href="' . $edit_link . '"><img src="' . IP_ROOT_PATH . $images['cms_icon_edit'] . '" alt="' . $lang['EDIT'] . '" title="' . $lang['EDIT'] . '" /></a>';
$delete_link = append_sid(THIS_FILE . '?' . $post_append_url . '&amp;mode=delete');
- $delete_img = '<a href="' . $delete_link . '"><img src="' . IP_ROOT_PATH . 'images/cms/b_delete.png" alt="' . $lang['DELETE'] . '" title="' . $lang['DELETE'] . '" /></a>';
+ $delete_img = '<a href="' . $delete_link . '"><img src="' . IP_ROOT_PATH . $images['cms_icon_delete'] . '" alt="' . $lang['DELETE'] . '" title="' . $lang['DELETE'] . '" /></a>';
}
$class = ($i % 2) ? $theme['td_class1'] : $theme['td_class2'];
View
6 trunk/guestbooks/ip_root/plugins/guestbooks/guestbooks.php
@@ -205,13 +205,13 @@
//$view_link = append_sid(THIS_FILE . '?mode=view&amp;' . $item_id . '=' . $items_array[$i][$item_id]);
$view_link = append_sid(CMS_PAGE_GUESTBOOK . '?' . $class_guestbooks->guestbook_id_var . '=' . $items_array[$i][$item_id]);
- $view_img = '<a href="' . $view_link . '"><img src="' . IP_ROOT_PATH . 'images/cms/b_preview.png" alt="' . $lang['GUESTBOOK_VIEW'] . '" title="' . $lang['GUESTBOOK_VIEW'] . '" /></a>';
+ $view_img = '<a href="' . $view_link . '"><img src="' . IP_ROOT_PATH . $images['cms_icon_preview'] . '" alt="' . $lang['GUESTBOOK_VIEW'] . '" title="' . $lang['GUESTBOOK_VIEW'] . '" /></a>';
$edit_link = append_sid(THIS_FILE . '?mode=input&amp;action=edit&amp;' . $item_id . '=' . $items_array[$i][$item_id]);
- $edit_img = '<a href="' . $edit_link . '"><img src="' . IP_ROOT_PATH . 'images/cms/b_edit.png" alt="' . $lang['EDIT'] . '" title="' . $lang['EDIT'] . '" /></a>';
+ $edit_img = '<a href="' . $edit_link . '"><img src="' . IP_ROOT_PATH . $images['cms_icon_edit'] . '" alt="' . $lang['EDIT'] . '" title="' . $lang['EDIT'] . '" /></a>';
$delete_link = append_sid(THIS_FILE . '?mode=delete&amp;' . $item_id . '=' . $items_array[$i][$item_id]);
- $delete_img = '<a href="' . $delete_link . '"><img src="' . IP_ROOT_PATH . 'images/cms/b_delete.png" alt="' . $lang['DELETE'] . '" title="' . $lang['DELETE'] . '" /></a>';
+ $delete_img = '<a href="' . $delete_link . '"><img src="' . IP_ROOT_PATH . $images['cms_icon_delete'] . '" alt="' . $lang['DELETE'] . '" title="' . $lang['DELETE'] . '" /></a>';
$class = ($i % 2) ? $theme['td_class1'] : $theme['td_class2'];
View
7 trunk/guestbooks/ip_root/plugins/guestbooks/info.php
@@ -15,13 +15,6 @@
$plugin_details = array();
-$lang_file = dirname(__FILE__) . '/language/lang_' . $config['default_lang'] . '/lang_info.' . PHP_EXT;
-if (!file_exists($lang_file))
-{
- $lang_file = dirname(__FILE__) . '/language/lang_english/lang_info.' . PHP_EXT;
-}
-@include($lang_file);
-
// Please note that config name will be prefixed with plugin_
$plugin_details['config'] = 'guestbooks';
$plugin_details['name'] = $lang['PLUGIN_GUESTBOOKS'];
View
4 trunk/guestbooks/ip_root/plugins/guestbooks/templates/default/guestbooks_body.tpl
@@ -2,7 +2,7 @@
<!-- IF S_INPUT_ALLOWED -->
<div class="css-button-wrap">
-<div class="forumline css-button-left"><div class="row1h css-button-body" onclick="window.location.href='{U_ITEM_ADD}'"><img src="images/cms/b_add.png" alt="{L_GUESTBOOK_ADD}" title="{L_GUESTBOOK_ADD}" />&nbsp;<b>{L_GUESTBOOK_ADD}</b>&nbsp;</div></div>
+<div class="forumline css-button-left"><div class="row1h css-button-body" onclick="window.location.href='{U_ITEM_ADD}'"><img src="{IMG_CMS_ICON_ADD}" alt="{L_GUESTBOOK_ADD}" title="{L_GUESTBOOK_ADD}" />&nbsp;<b>{L_GUESTBOOK_ADD}</b>&nbsp;</div></div>
</div>
<!-- ENDIF -->
@@ -55,7 +55,7 @@
<!-- IF S_INPUT_ALLOWED -->
<div class="css-button-wrap">
-<div class="forumline css-button-left"><div class="row1h css-button-body" onclick="window.location.href='{U_ITEM_ADD}'"><img src="images/cms/b_add.png" alt="{L_GUESTBOOK_ADD}" title="{L_GUESTBOOK_ADD}" />&nbsp;<b>{L_GUESTBOOK_ADD}</b>&nbsp;</div></div>
+<div class="forumline css-button-left"><div class="row1h css-button-body" onclick="window.location.href='{U_ITEM_ADD}'"><img src="{IMG_CMS_ICON_ADD}" alt="{L_GUESTBOOK_ADD}" title="{L_GUESTBOOK_ADD}" />&nbsp;<b>{L_GUESTBOOK_ADD}</b>&nbsp;</div></div>
</div>
<!-- ENDIF -->
View
9 trunk/kb/ip_root/kb_search.php
@@ -58,11 +58,10 @@
if (($search_id == '') || ($search_keywords != ''))
{
- $stopword_array = @file(IP_ROOT_PATH . 'language/lang_' . $config['default_lang'] . '/search_stopwords.txt');
- $synonym_array = @file(IP_ROOT_PATH . 'language/lang_' . $config['default_lang'] . '/search_synonyms.txt');
+ stopwords_synonyms_init();
$split_search = array();
- $split_search = (!strstr($multibyte_charset, $lang['ENCODING'])) ? split_words(clean_words('search', stripslashes($search_keywords), $stopword_array, $synonym_array), 'search') : split(' ', $search_keywords);
+ $split_search = (!strstr($multibyte_charset, $lang['ENCODING'])) ? split_words(clean_words('search', stripslashes($search_keywords), $stopwords_array, $synonyms_array), 'search') : split(' ', $search_keywords);
$search_msg_only = (!$search_fields) ? "AND m.title_match = 0" : ((strstr($multibyte_charset, $lang['ENCODING'])) ? '' : '');
@@ -293,9 +292,9 @@
$highlight_match[] = '#\b(' . str_replace("*", "([\w]+)?", $split_word) . ')\b#is';
$highlight_active .= " " . $split_word;
- for ($k = 0; $k < sizeof($synonym_array); $k++)
+ for ($k = 0; $k < sizeof($synonyms_array); $k++)
{
- list($replace_synonym, $match_synonym) = split(' ', trim(strtolower($synonym_array[$k])));
+ list($replace_synonym, $match_synonym) = split(' ', trim(strtolower($synonyms_array[$k])));
if ($replace_synonym == $split_word)
{
View
8 trunk/kb/ip_root/plugins/kb/adm/admin_kb_cat.php
@@ -521,16 +521,16 @@ function get_forums($sel_id = 0)
$category_link = '<a href="' . $temp_url . '" class="gen">' . $category_name . '</a>';
$temp_url = append_sid(KB_ADM_PATH . 'admin_kb_cat.' . PHP_EXT . '?mode=edit&amp;cat=' . $category_id);
- $edit = '<a href="' . $temp_url . '"><img src="../images/cms/b_edit.png" alt="' . $lang['Edit'] . '"></a>';
+ $edit = '<a href="' . $temp_url . '"><img src="' . IP_ROOT_PATH . $images['cms_icon_edit'] . '" alt="' . $lang['Edit'] . '"></a>';
$temp_url = append_sid(KB_ADM_PATH . 'admin_kb_cat.' . PHP_EXT . '?mode=delete&amp;cat=' . $category_id);
- $delete = '<a href="' . $temp_url . '"><img src="../images/cms/b_delete.png" alt="' . $lang['Delete'] . '"></a>';
+ $delete = '<a href="' . $temp_url . '"><img src="' . IP_ROOT_PATH . $images['cms_icon_delete'] . '" alt="' . $lang['Delete'] . '"></a>';
$temp_url = append_sid(KB_ADM_PATH . 'admin_kb_cat.' . PHP_EXT . '?mode=up&amp;cat=' . $category_id);
- $up = '<a href="' . $temp_url . '"><img src="../images/cms/arrow_up.png" alt="' . $lang['Move_up'] . '"></a>';
+ $up = '<a href="' . $temp_url . '"><img src="' . IP_ROOT_PATH . $images['cms_arrow_up'] . '" alt="' . $lang['MOVE_UP'] . '"></a>';
$temp_url = append_sid(KB_ADM_PATH . 'admin_kb_cat.' . PHP_EXT . '?mode=down&amp;cat=' . $category_id);
- $down = '<a href="' . $temp_url . '"><img src="../images/cms/arrow_down.png" alt="' . $lang['Move_down'] . '"></a>';
+ $down = '<a href="' . $temp_url . '"><img src="' . IP_ROOT_PATH . $images['cms_arrow_down'] . '" alt="' . $lang['MOVE_DOWN'] . '"></a>';
$row_class = (!($ss % 2)) ? $theme['td_class1'] : $theme['td_class2'];
View
8 trunk/kb/ip_root/plugins/kb/includes/functions_kb.php
@@ -658,7 +658,7 @@ function kb_insert_pm($to_id, $message, $subject, $from_id, $html_on = 0, $acro_
if (!$result)
{
$error = true;
- $error_msg = $lang['No_such_user'];
+ $error_msg = $lang['NO_USER'];
}
$to_userdata = $db->sql_fetchrow($result);
@@ -791,7 +791,7 @@ function kb_mailer($to_id, $message, $subject, $from_id, $html_on = 0, $acro_aut
if (!$result)
{
$error = true;
- $error_msg = $lang['No_such_user'];
+ $error_msg = $lang['NO_USER'];
}
$to_userdata = $db->sql_fetchrow($result);
@@ -982,10 +982,10 @@ function get_kb_cat_subs_admin($parent, $select = 1, $indent, $ss)
$delete2 = '<a href="' . $temp_url . '" class="gen">' . $lang['Delete'] . '</a>';
$temp_url = append_sid('admin_kb_cat.' . PHP_EXT . '?mode=up&amp;cat=' . $category_id2);
- $up2 = '<a href="' . $temp_url . '" class="gen">' . $lang['Move_up'] . '</a>';
+ $up2 = '<a href="' . $temp_url . '" class="gen">' . $lang['MOVE_UP'] . '</a>';
$temp_url = append_sid(IP_ROOT_PATH . ADM . '/admin_kb_cat.' . PHP_EXT . '?mode=down&amp;cat=' . $category_id2);
- $down2 = '<a href="' . $temp_url . '" class="gen">' . $lang['Move_down'] . '</a>';
+ $down2 = '<a href="' . $temp_url . '" class="gen">' . $lang['MOVE_DOWN'] . '</a>';
$row_class = (!($ss % 2)) ? $theme['td_class1'] : $theme['td_class2'];
View
7 trunk/kb/ip_root/plugins/kb/includes/functions_kb_mx.php
@@ -130,12 +130,11 @@ function mx_add_search_words($mode, $post_id, $post_text, $post_title = '', $mx_
break;
}
- $stopword_array = @file(IP_ROOT_PATH . 'language/lang_' . $config['default_lang'] . "/search_stopwords.txt");
- $synonym_array = @file(IP_ROOT_PATH . 'language/lang_' . $config['default_lang'] . "/search_synonyms.txt");
+ stopwords_synonyms_init();
$search_raw_words = array();
- $search_raw_words['text'] = split_words(clean_words('post', $post_text, $stopword_array, $synonym_array));
- $search_raw_words['title'] = split_words(clean_words('post', $post_title, $stopword_array, $synonym_array));
+ $search_raw_words['text'] = split_words(clean_words('post', $post_text, $stopwords_array, $synonyms_array));
+ $search_raw_words['title'] = split_words(clean_words('post', $post_title, $stopwords_array, $synonyms_array));
@set_time_limit(0);
View
7 trunk/kb/ip_root/plugins/kb/info.php
@@ -15,13 +15,6 @@
$plugin_details = array();
-$lang_file = dirname(__FILE__) . '/language/lang_' . $config['default_lang'] . '/lang_info.' . PHP_EXT;
-if (!file_exists($lang_file))
-{
- $lang_file = dirname(__FILE__) . '/language/lang_english/lang_info.' . PHP_EXT;
-}
-@include($lang_file);
-
// Please note that config name will be prefixed with plugin_
$plugin_details['config'] = 'kb';
$plugin_details['name'] = $lang['PLUGIN_KB'];

0 comments on commit c0c2894

Please sign in to comment.