• R/O
  • SSH
  • HTTPS

researchclip: Commit


Commit MetaInfo

Revision38 (tree)
Time2009-04-04 12:05:47
Authorwalgbart

Log Message

modules/rss_import/rss_import_init.php:
modules/rss_import/templates/rss_import_admin_link.tpl:
管理画面head-navにRSS Importの設定画面へのリンクを
挿入する設定が不十分だったのを修正

modules/rss_import/rss_import_main.php:
feedの項目を取得する処理が不十分なのを修正
名前空間付きのタグが2番目にくるときに","を付加できない不具合を修正

languages/lang_english.conf:
PLIGG_Visual_Recently_Popの設定が壊れていたのを修正

templates/wistie/footer.tpl:
templates/wistie/link_summary.tpl:
HTMLを少しvalidに近づけた

templates/wistie/css/style.css:
マイナスの評価を持つコメントを非表示ではなく半透明表示のstylへ変更
コメントvoteの表示がひどいので仮のスタイルを設定

templates/wistie/comment_show.tpl:
マイナスの評価を持つコメントを非表示ではなく半透明表示にした
voteしてもvote値を表示するように変更
わかりにくいので返信とvotesとbuttonsの順序を変更

templates/xmlhttp.php:
使われていないidへの参照をコメントアウト
半透明処理のため評価が+/-を判断するため
3つ目の引数としてvalueをchnagecvotevaluesに追加
show_hide_user_linksが定義されていないので
templates/admin/js/pligg_effects.jsからコピペ

rss_import_init.php:
admin_rss_import.php:
rss_import_main.php:
class.rssimport.php:
lang.conf:
create_feed_tables.php:
import.php:
rss_import_settings.php:
rss_import_install.php:
rss_importのモジュールファイルなので削除

Change Summary

Incremental Difference

--- pligg/trunk/pligg/import.php (revision 37)
+++ pligg/trunk/pligg/import.php (nonexistent)
@@ -1,21 +0,0 @@
1-<?php
2-
3-if (strpos($_SERVER['SCRIPT_NAME'], 'rss_import') > 1){
4- die('you need to copy this file into your root Pligg folder.');
5-}
6-
7-include_once('Smarty.class.php');
8-$main_smarty = new Smarty;
9-
10- include_once('config.php');
11- include_once(mnminclude.'html1.php');
12- include_once(mnminclude.'link.php');
13- include_once(mnminclude.'tags.php');
14- include_once(mnminclude.'smartyvariables.php');
15-
16- include_once('modules/rss_import/rss_import_settings.php');
17- include_once('modules/rss_import/rss_import_main.php');
18-
19- rss_import_do_import(false);
20-
21-?>
--- pligg/trunk/pligg/rss_import_settings.php (revision 37)
+++ pligg/trunk/pligg/rss_import_settings.php (nonexistent)
@@ -1,37 +0,0 @@
1-<?php
2-
3-// the path to the module. the probably shouldn't be changed unless you rename the share_revenue folder(s)
4-define('rss_import_path', my_pligg_base . '/modules/rss_import/');
5-
6-// the language path for the module
7- if(!defined('lang_loc')){
8- // determine if we're in root or another folder like admin
9- $pos = strrpos($_SERVER["SCRIPT_NAME"], "/");
10- $path = substr($_SERVER["SCRIPT_NAME"], 0, $pos);
11- if ($path == "/"){$path = "";}
12-
13- if($path != my_pligg_base){
14- define('lang_loc', '..');
15- } else {
16- define('lang_loc', '.');
17- }
18- }
19-define('rss_import_lang_conf', lang_loc . '/modules/rss_import/lang.conf');
20-define('rss_import_pligg_lang_conf', lang_loc . "/languages/lang_" . pligg_language . ".conf");
21-
22-// the path to the modules templates. the probably shouldn't be changed unless you rename the rss_import folder(s)
23-define('rss_import_tpl_path', '../modules/rss_import/templates/');
24-define('rss_import_tpl_path_2', 'modules/rss_import/templates/');
25-// the path for smarty / template lite plugins
26-define('rss_import_plugins_path', '../modules/rss_import/plugins');
27-
28-// don't touch anything past this line.
29-
30-if(is_object($main_smarty)){
31- $main_smarty->assign('rss_import_path', rss_import_path);
32- $main_smarty->assign('rss_import_pligg_lang_conf', rss_import_lang_conf);
33- $main_smarty->assign('rss_import_tpl_path', rss_import_tpl_path);
34- $main_smarty->assign('rss_import_tpl_path_2', rss_import_tpl_path_2);
35-}
36-
37-?>
--- pligg/trunk/pligg/rss_import_main.php (revision 37)
+++ pligg/trunk/pligg/rss_import_main.php (nonexistent)
@@ -1,452 +0,0 @@
1-<?php
2-
3- function rss_import_showpage(){
4- global $main_smarty, $the_template, $db;
5-
6- include_once('config.php');
7- include_once(mnminclude.'html1.php');
8- include_once(mnminclude.'link.php');
9- include_once(mnminclude.'tags.php');
10- include_once(mnminclude.'smartyvariables.php');
11-
12- require_once('class.rssimport.php');
13- require_once('magpierss/rss_fetch.inc');
14- define('MAGPIE_CACHE_DIR', 'cache/templates_c/');
15- define('rss_import_export_version', '0.4');
16- $smarty = $main_smarty;
17- include_once(mnminclude.'qeip_0_3.php');
18-
19- force_authentication();
20-
21- $amIgod = 0;
22- $amIgod = $amIgod + checklevel('god');
23-
24- // pagename
25- define('modulename', 'rss_import');
26- $main_smarty->assign('modulename', modulename);
27-
28- // breadcrumbs and page title
29- $navwhere['text1'] = $smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel');
30- $navwhere['link1'] = getmyurl('admin', '');
31- $navwhere['text2'] = $smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel_RSSImport');
32- $smarty->assign('navbar_where', $navwhere);
33- $smarty->assign('posttitle', ' / ' . $smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel_RSSImport'));
34-
35- // sidebar
36- $main_smarty = do_sidebar($main_smarty);
37-
38-
39- if($amIgod == 1){
40-
41- $tableexists = checkfortable(table_prefix . 'feeds');
42- if (!$tableexists) {
43- echo "Creating Tables<hr />";
44- include_once( 'create_feed_tables.php' );
45- die("<hr />If there are no errors then refresh this page to continue");
46- }
47-
48- $filename = 'create_feed_tables.php';
49- if (file_exists($filename)) {
50- // die("Please delete or rename the file create_feed_tables.php, then refresh this page");
51- }
52-
53- $smarty->register_function('feedsListFeeds', 'smarty_function_feedsListFeeds');
54- $smarty->register_function('feedsListFeedLinks', 'smarty_function_feedsListFeedLinks');
55- $smarty->register_function('feedsListFeedFields', 'smarty_function_feedsListFeedFields');
56- $smarty->register_function('feedsListPliggLinkFields', 'smarty_function_feedsListPliggLinkFields');
57-
58- $QEIPA = array('table_name' => table_prefix . 'feeds', // the name of the table to use
59- 'field_name' => 'feed_name', // the name of the field in the table
60- 'key' => 'feed_id'); // a unique identifier for the row
61- $smarty->assign('qeip_FeedName', $QEIPA);
62-
63- $QEIPA = array('table_name' => table_prefix . 'feeds', // the name of the table to use
64- 'field_name' => 'feed_url', // the name of the field in the table
65- 'key' => 'feed_id'); // a unique identifier for the row
66- $smarty->assign('qeip_FeedURL', $QEIPA);
67-
68- $QEIPA = array('table_name' => table_prefix . 'feeds', // the name of the table to use
69- 'field_name' => 'feed_category', // the name of the field in the table
70- 'key' => 'feed_id'); // a unique identifier for the row
71- $smarty->assign('qeip_FeedCategory', $QEIPA);
72-
73- $QEIPA = array('table_name' => table_prefix . 'feeds', // the name of the table to use
74- 'field_name' => 'feed_freq_hours', // the name of the field in the table
75- 'key' => 'feed_id', // a unique identifier for the row
76- 'field_type' => 'number'); // the type of database field we are reading from / writing to
77- $smarty->assign('qeip_FeedFreqHours', $QEIPA);
78-
79- $QEIPA = array('table_name' => table_prefix . 'feeds', // the name of the table to use
80- 'field_name' => 'feed_votes', // the name of the field in the table
81- 'key' => 'feed_id', // a unique identifier for the row
82- 'field_type' => 'number'); // the type of database field we are reading from / writing to
83- $smarty->assign('qeip_FeedVotes', $QEIPA);
84-
85- $QEIPA = array('table_name' => table_prefix . 'feeds', // the name of the table to use
86- 'field_name' => 'feed_item_limit', // the name of the field in the table
87- 'key' => 'feed_id', // a unique identifier for the row
88- 'field_type' => 'number'); // the type of database field we are reading from / writing to
89- $smarty->assign('qeip_FeedItemLimit', $QEIPA);
90-
91- $QEIPA = array('table_name' => table_prefix . 'feeds', // the name of the table to use
92- 'field_name' => 'feed_url_dupe', // the name of the field in the table
93- 'key' => 'feed_id', // a unique identifier for the row
94- 'field_type' => 'number'); // the type of database field we are reading from / writing to
95- $smarty->assign('qeip_FeedURLDupe', $QEIPA);
96-
97- $QEIPA = array('table_name' => table_prefix . 'feeds', // the name of the table to use
98- 'field_name' => 'feed_title_dupe', // the name of the field in the table
99- 'key' => 'feed_id', // a unique identifier for the row
100- 'field_type' => 'number'); // the type of database field we are reading from / writing to
101- $smarty->assign('qeip_FeedTitleDupe', $QEIPA);
102-
103- $QEIPA = array('table_name' => table_prefix . 'feeds', // the name of the table to use
104- 'field_name' => 'feed_submitter', // the name of the field in the table
105- 'key' => 'feed_id', // a unique identifier for the row
106- 'field_type' => 'number'); // the type of database field we are reading from / writing to
107- $smarty->assign('qeip_FeedSubmitter', $QEIPA);
108-
109- $QEIPA = array('table_name' => table_prefix . 'feed_link', // the name of the table to use
110- 'field_name' => 'feed_field', // the name of the field in the table
111- 'key' => 'feed_link_id', // a unique identifier for the row
112- 'eip_type' => 'select'); // the type of EIP field to show
113- $smarty->assign('qeip_FeedLink_FeedField', $QEIPA);
114-
115- $QEIPA = array('table_name' => table_prefix . 'feed_link', // the name of the table to use
116- 'field_name' => 'pligg_field', // the name of the field in the table
117- 'key' => 'feed_link_id', // a unique identifier for the row
118- 'eip_type' => 'select'); // the type of EIP field to show
119- $smarty->assign('qeip_FeedLink_PliggField', $QEIPA);
120-
121-
122- // feed oldest first
123- $QEIPA = array('table_name' => table_prefix . 'feeds', // the name of the table to use
124- 'field_name' => 'feed_last_item_first', // the name of the field in the table
125- 'key' => 'feed_id'); // a unique identifier for the row
126- $smarty->assign('qeip_FeedLastItemFirst', $QEIPA);
127-
128- // feed random vote
129- $QEIPA = array('table_name' => table_prefix . 'feeds', // the name of the table to use
130- 'field_name' => 'feed_random_vote_enable', // the name of the field in the table
131- 'key' => 'feed_id'); // a unique identifier for the row
132- $smarty->assign('qeip_FeedRandomVoteEnable', $QEIPA);
133-
134- // feed random vote min
135- $QEIPA = array('table_name' => table_prefix . 'feeds', // the name of the table to use
136- 'field_name' => 'feed_random_vote_min', // the name of the field in the table
137- 'key' => 'feed_id', // a unique identifier for the row
138- 'field_type' => 'number'); // the type of database field we are reading from / writing to
139- $smarty->assign('qeip_FeedRandomVotesMin', $QEIPA);
140-
141- // feed random vote max
142- $QEIPA = array('table_name' => table_prefix . 'feeds', // the name of the table to use
143- 'field_name' => 'feed_random_vote_max', // the name of the field in the table
144- 'key' => 'feed_id', // a unique identifier for the row
145- 'field_type' => 'number'); // the type of database field we are reading from / writing to
146- $smarty->assign('qeip_FeedRandomVotesMax', $QEIPA);
147-
148-
149-
150- $QEIP = new QuickEIP();
151-
152-
153- if(!isset($_REQUEST['action'])){
154-
155- $smarty->assign('tpl_center', rss_import_tpl_path . 'admin_rss_center');
156- $main_smarty->display($template_dir . '/admin/admin.tpl');
157- echo $QEIP->ShowOnloadJS();
158- }else{
159-
160- if($_REQUEST['action'] == "addnewfieldlink"){
161- $RSSImport=new RSSImport;
162- $RSSImport->FeedLinkId = $_REQUEST['FeedLinkId'];
163- $RSSImport->new_field_link();
164- redirect('module.php?module=rss_import&action=editfeed&feed_id='.$_REQUEST['FeedLinkId']);
165- }
166-
167- if($_REQUEST['action'] == "dropfieldlink"){
168- $RSSImport=new RSSImport;
169- $RSSImport->FeedLinkId=$_REQUEST['FeedLinkId'];
170- $RSSImport->drop_field_link();
171- redirect('module.php?module=rss_import');
172- }
173-
174- if($_REQUEST['action'] == "addnewfeed"){
175- $RSSImport=new RSSImport;
176- $RSSImport->FeedName="New Feed";
177- $RSSImport->new_feed();
178- redirect('module.php?module=rss_import');
179- }
180-
181- if($_REQUEST['action'] == "dropfeed"){
182- $RSSImport=new RSSImport;
183- $RSSImport->FeedId=$_REQUEST['feed_id'];
184- $RSSImport->drop_feed();
185- redirect('module.php?module=rss_import');
186- }
187-
188- if($_REQUEST['action'] == "save"){
189- echo $QEIP->save_field($smarty);
190- }
191-
192- if($_REQUEST['action'] == "examinefeed"){
193- $RSSImport=new RSSImport;
194- $RSSImport->FeedId=$_REQUEST['feed_id'];
195- $RSSImport->read_feed();
196- $rss = fetch_rss($RSSImport->FeedURL);
197- $z = $rss->items[0];
198- if($z){
199- echo 'First item in the feed.<hr />';
200- print_r_html($z);
201- echo '<hr />Feed dump.<hr />';
202- print_r_html($rss);
203- } else {
204- echo '<hr />There are no items in this feed<hr />';
205- }
206-
207- }
208-
209- if($_REQUEST['action'] == "editfeed"){
210- $RSSImport=new RSSImport;
211- $RSSImport->FeedId=$_REQUEST['feed_id'];
212- $smarty->assign('tpl_center', rss_import_tpl_path . 'admin_rss_center2');
213- $main_smarty->display($template_dir . '/admin/admin.tpl');
214- }
215-
216- if($_REQUEST['action'] == "exportfeed"){
217- echo 'copy all the text in the box<br />';
218- echo '<textarea rows=10 cols=70>' . serialize_feed($_REQUEST['feed_id']) . '</textarea>';
219- echo '<br /><br /><a href = "module.php?module=rss_import">return to the rss importer</a>';
220- }
221-
222- if($_REQUEST['action'] == "importprebuiltfeed_go"){
223- $feed = stripslashes($_REQUEST['prebuiltfeed']);
224-
225- if(strpos($feed, '://') < 10){
226- $r = new HTTPRequest($feed);
227- $feed = $r->DownloadToString();
228- }
229-
230- if(import_prebuilt($feed)){
231- redirect(my_pligg_base . '/module.php?module=rss_import');
232- } else {
233- // what do we do if error?
234- }
235- }
236-
237- }
238- //echo $QEIP->ShowOnloadJS();
239- }
240-
241-
242-
243- }
244-
245- function import_prebuilt($serialized_feed)
246- {
247- global $db;
248-
249- $x = unserialize($serialized_feed);
250-
251- if($x['version'] == rss_import_export_version){
252- foreach($x['feeds'] as $myfeed){
253-
254- $feed_main = $myfeed['main'];
255-
256- unset($feed_main->feed_last_check);
257- $feed_main->feed_submitter = 1;
258-
259- $last_feed_id = $db->get_var('SELECT `feed_id` FROM `' . table_prefix . 'feeds` order by `feed_id` DESC limit 1');
260-
261- $feed_main->feed_id = $last_feed_id + 1;
262-
263- $sql = "Insert Into `" . table_prefix . "feeds` (`feed_id`, `feed_name`, `feed_url`, `feed_freq_hours`, `feed_votes`";
264- $sql .= ", `feed_submitter`, `feed_item_limit`, `feed_category`, `feed_url_dupe`, `feed_title_dupe`";
265- $sql .= ", `feed_status`, `feed_last_item_first`) VALUES (";
266-
267- $sql .= $feed_main->feed_id . ", '" . $feed_main->feed_name . "', '" . $feed_main->feed_url . "', ";
268- $sql .= $feed_main->feed_freq_hours . ", " . $feed_main->feed_votes . ", " . $feed_main->feed_submitter;
269- $sql .= ", " . $feed_main->feed_item_limit . ", " . $feed_main->feed_category . ", ";
270- $sql .= $feed_main->feed_url_dupe . ", " . $feed_main->feed_title_dupe . ", '" . $feed_main->feed_status;
271- $sql .= "', '" . $feed_main->feed_last_item_first . "');";
272- $db->query($sql);
273-
274- foreach($myfeed['links'] as $field_link){
275- $sql = "insert into `" . table_prefix . "feed_link` (`feed_id`, `feed_field`, `pligg_field`)";
276- $sql .= " VALUES (" . $feed_main->feed_id . ", '" . $field_link->feed_field;
277- $sql .= "', '" . $field_link->pligg_field . "');";
278- $db->query($sql);
279- }
280-
281- return true;
282- }
283- } else {
284- echo 'incompatible version';
285- return false;
286- }
287- }
288-
289-
290- function serialize_feed($feed_id)
291- {
292- global $db;
293- $feed_main = $db->get_row("select * from " . table_prefix . "feeds where feed_id = " . $feed_id);
294- unset($feed_main->feed_last_check);
295- $feed_links = $db->get_results("select * from " . table_prefix . "feed_link where feed_id = " . $feed_id);
296- $x = array('version'=> rss_import_export_version, 'main' => $feed_main, 'links' => $feed_links);
297- $y = array('version'=> rss_import_export_version, 'feeds' => array($x));
298- return serialize($y);
299- }
300-
301- function rss_import_do_import($insideTpl = true){
302- global $main_smarty, $the_template;
303-
304- include_once('config.php');
305- include_once(mnminclude.'html1.php');
306- include_once(mnminclude.'link.php');
307- include_once(mnminclude.'tags.php');
308- include_once(mnminclude.'smartyvariables.php');
309-
310- require_once('class.rssimport.php');
311- require_once('magpierss/rss_fetch.inc');
312- define('MAGPIE_CACHE_DIR', 'cache/templates_c/');
313-
314- // breadcrumbs and page title
315- $navwhere['text1'] = $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel');
316- $navwhere['link1'] = getmyurl('admin', '');
317- $navwhere['text2'] = $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel_RSSImport');
318- $navwhere['link2'] = my_pligg_base . '/module.php?module=rss_import';
319- $navwhere['text3'] = $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel_RSSImport_Feeds');
320- $main_smarty->assign('navbar_where', $navwhere);
321- $main_smarty->assign('posttitle', ' / ' . $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel_RSSImport'));
322-
323- // show the template
324- if ($insideTpl == true){
325- $main_smarty->assign('tpl_center', rss_import_tpl_path . 'import_fields_center');
326- $main_smarty->display($template_dir . '/admin/admin.tpl');
327- } else {
328- $main_smarty->display(rss_import_tpl_path_2 . 'import_fields_center.tpl');
329- }
330- }
331-
332-
333-// FEED FUNCTIONS
334-
335-function smarty_function_feedsListFeeds($params, &$smarty)
336-{
337- // get a list of feeds in the database and put them into smarty varliable $params['varname']
338- global $db;
339- $smarty->assign($params['varname'], $db->get_col("select feed_id from " . table_prefix . "feeds"));
340-}
341-
342-function smarty_function_feedsListFeedLinks($params, &$smarty)
343-{
344- // get a list of all field_links where `feed_id` = $feed_id and put them into the smarty variable $params['varname']
345- global $db;
346- $smarty->assign($params['varname'], $db->get_col("select feed_link_id from " . table_prefix . "feed_link where feed_id = " . $params['feedid']));
347-}
348-
349-function smarty_function_feedsListFeedFields($params, &$smarty)
350-{
351- // get a list of fields in the RSS feed and put them into the smarty variable "eip_select" for the EIP selectbox to use
352- global $db;
353- $smarty->assign('eip_select', "");
354- //$url = "http://localhost/nik.xml";
355- $feed_url = $db->get_var("select feed_url from " . table_prefix . "feeds where feed_id = " . $params['feed_id']);
356- $rss = fetch_rss($feed_url);
357- $x = sizeof($rss->items[0]);
358- $z = $rss->items[0];
359-
360- $TheTextToReturn = " options: {";
361-
362- $count = -1;
363- foreach ($z as $item => $key) {
364- if ($count < $x){
365- if (is_array($z[$item])) {
366- foreach ($z[$item] as $item2 => $key) {
367- if($count > 0){$TheTextToReturn .= ", ";}
368- $TheTextToReturn .= $item . "_ne_st_ed_" . $item2 . ": '" . $item . " : " . $item2 . "'";
369- $count = $count + 1;
370- }
371- } else {
372- if($count > -1){$TheTextToReturn .= ", ";}
373- $TheTextToReturn .= $item . ": '" . $item . "'";
374- $count = $count + 1;
375- }
376- }
377- }
378- $TheTextToReturn .= "}";
379-
380- $smarty->assign('eip_select', $TheTextToReturn);
381-
382-}
383-
384-function get_pligg_fields(){
385- global $db;
386- $sql = "select * from " . table_prefix . "feed_import_fields;";
387- $pligg_fields = $db->get_results($sql);
388- return $pligg_fields;
389-}
390-
391-function smarty_function_feedsListPliggLinkFields($params, &$smarty){
392- // get a list of pligg fields and put them into the smarty variable "eip_select" for the EIP selectbox to use
393- $Pligg_Fields = get_pligg_fields();
394- $TheTextToReturn = " options: {";
395- $Count = 0;
396- if($Pligg_Fields){
397- foreach ($Pligg_Fields as $Field) {
398-
399- if($count > 0){$TheTextToReturn .= ", ";}
400- $TheTextToReturn .= $Field->field_name . ": '" . $Field->field_name . "'";
401- $count = $count + 1;
402-
403- }
404- }
405-
406- $TheTextToReturn .= "}";
407-
408- $smarty->assign('eip_select', $TheTextToReturn);
409-
410-}
411-
412-function checkfortable($table)
413-{
414- $result = mysql_query('select * from ' . $table);
415- if (!$result) {
416- return false;
417- }
418- return true;
419-}
420-
421-function redirect($url, $msg){
422- // due to some servers not redirecting the way we would like we
423- // have this function to handle that
424-
425- global $main_smarty;
426-
427- if(strpos($_SERVER['SERVER_SOFTWARE'], "IIS") && strpos(php_sapi_name(), "cgi") >= 0){
428- header("Expires: " . gmdate("r", time()-3600));
429- // use js to try to redirect
430- echo '<SCRIPT LANGUAGE="JavaScript">window.location="' . $url . '";</script>';
431- // in case the js fails show a link
432- echo $main_smarty->get_config_vars($msg) . '<a href = "'.$url.'">' . $main_smarty->get_config_vars('PLIGG_Visual_IIS_Continue') . '</a>';
433- } else {
434- header('Location: ' . $url);
435- }
436-}
437-
438-
439-function print_r_html($data,$return_data=false)
440-{
441- $data = print_r($data,true);
442- $data = str_replace( " ","&nbsp;", $data);
443- $data = str_replace( "\r\n","<br>\r\n", $data);
444- $data = str_replace( "\r","<br>\r", $data);
445- $data = str_replace( "\n","<br>\n", $data);
446-
447- if (!$return_data)
448- echo $data;
449- else
450- return $data;
451-}
452-?>
\ No newline at end of file
--- pligg/trunk/pligg/class.rssimport.php (revision 37)
+++ pligg/trunk/pligg/class.rssimport.php (nonexistent)
@@ -1,182 +0,0 @@
1-<?php
2-// The source code packaged with this file is Free Software, Copyright (C) 2005 by
3-// The Pligg Team <pligger at pligg dot com>.
4-// It's licensed under the AFFERO GENERAL PUBLIC LICENSE unless stated otherwise.
5-// You can get copies of the licenses here:
6-// http://www.affero.org/oagpl.html
7-// AFFERO GENERAL PUBLIC LICENSE is also included in the file called "COPYING".
8-
9-
10-// TODO
11-
12-// when adding a new feed and you edit the url first, it doesnt save
13-// when deleting a feed, need to first drop_all_links for that feed and also import data
14-
15-
16-
17-class RSSImport {
18-
19- var $FeedName = "";
20- var $FeedURL = "";
21- var $FeedId = 0;
22-
23- var $FeedLinkId = 0;
24- var $FeedLinkField = "";
25- var $FeedLinkPligg = "";
26-
27- function read_feed(){
28- global $db;
29- $sql = "SELECT * FROM " . table_prefix . "feeds WHERE feed_id = $this->FeedId";
30- //echo "<HR>" . $sql . "<HR>";
31- $config = $db->get_row($sql);
32-
33- $this->FeedName=$config->feed_name;
34- $this->FeedURL=$config->feed_url;
35- $this->FeedId=$config->feed_id;
36-
37- return true;
38- }
39-
40- function drop_feed(){
41- global $db;
42- $sql = "Delete from " . table_prefix . "feeds where feed_id = ".$this->FeedId.";";
43- $db->query($sql);
44-
45- $sql = "Delete from " . table_prefix . "feed_link where feed_id = ".$this->FeedId.";";
46- $db->query($sql);
47- }
48-
49- function new_feed(){
50- global $db;
51- $sql = "INSERT INTO " . table_prefix . "feeds (feed_name, feed_url) VALUES('".$this->FeedName."', '".$this->FeedURL."');";
52- //echo "<HR>" . $sql . "<HR>";
53- $db->query($sql);
54- }
55-
56- function store_feed(){
57- global $db;
58- $sql = "UPDATE " . table_prefix . "feeds set feed_name = '".$this->FeedName."', feed_url = '".$this->FeedURL."' where feed_id = ".$this->FeedId.";";
59- echo "<HR>" . $sql . "<HR>";
60- $db->query($sql);
61- }
62-
63- function get_feeds_lists(){
64- global $db;
65- $feeds_list = $db->get_results("select * from " . table_prefix . "feeds");
66- return $feeds_list;
67- }
68-
69- function get_feed_field_links($feed_id=0){
70- global $db;
71- if(!isset($feed_id)){$feed_id = $this->FeedId;}
72- $sql = "select * from " . table_prefix . "feed_link where feed_id = " . $feed_id;
73- //echo "<HR>" . $sql . "<HR>";
74- $feed_field_links = $db->get_results($sql);
75- return $feed_field_links;
76- }
77-
78-
79- //---------------------------------
80- // For Feed_Links
81- //---------------------------------
82-
83- function get_pligg_fields(){
84- global $db;
85- $sql = "select * from " . table_prefix . "feed_import_fields;";
86- $pligg_fields = $db->get_results($sql);
87- return $pligg_fields;
88- }
89-
90- function EIP_Feed_Field_Select($feed_url=""){
91-
92- $rss = fetch_rss($feed_url);
93-
94- $x = sizeof($rss->items[1]);
95- $z = $rss->items[0];
96-
97- $TheTextToReturn = " options: {";
98-
99- $count = 0;
100- foreach ($z as $item => $key) {
101- if ($count < $x){
102- //echo $item . "<BR>";
103-
104- if (is_array($z[$item])) {
105- foreach ($z[$item] as $item2 => $key) {
106- if($count > 0){$TheTextToReturn .= ", ";}
107- $TheTextToReturn .= $item . "_ne_st_ed_" . $item2 . ": '" . $item . " : " . $item2 . "'";
108- $count = $count + 1;
109- }
110- } else {
111- if($count > 0){$TheTextToReturn .= ", ";}
112- $TheTextToReturn .= $item . ": '" . $item . "'";
113- $count = $count + 1;
114- }
115- }
116- }
117- $TheTextToReturn .= "}";
118-
119- return $TheTextToReturn;
120-
121- }
122-
123-
124- function EIP_Pligg_Field_Select(){
125-
126- $Pligg_Fields = $this->get_pligg_fields();
127- $TheTextToReturn = " options: {";
128- $Count = 0;
129- if($Pligg_Fields){
130- foreach ($Pligg_Fields as $Field) {
131-
132- if($count > 0){$TheTextToReturn .= ", ";}
133- $TheTextToReturn .= $Field->field_name . ": '" . $Field->field_name . "'";
134- $count = $count + 1;
135-
136- }
137- }
138-
139- $TheTextToReturn .= "}";
140-
141- return $TheTextToReturn;
142-
143- }
144-
145- function read_feed_link(){
146- global $db;
147- $sql = "SELECT * FROM " . table_prefix . "feed_link WHERE feed_link_id = $this->FeedLinkId";
148- //echo "<HR>" . $sql . "<HR>";
149- $config = $db->get_row($sql);
150-
151- $this->FeedLinkField=$config->feed_field;
152- $this->FeedLinkPligg=$config->pligg_field;
153- $this->FeedLinkId=$config->feed_link_id;
154- $this->FeedId=$config->feed_id;
155-
156- return true;
157- }
158-
159- function store_feed_link(){
160- global $db;
161- $sql = "UPDATE " . table_prefix . "feed_link set feed_id = '".$this->FeedId."', feed_field = '".$this->FeedLinkField."', pligg_field = '".$this->FeedLinkPligg."' where feed_link_id = ".$this->FeedLinkId.";";
162- echo "<HR>" . $sql . "<HR>";
163- $db->query($sql);
164- }
165-
166- function new_field_link(){
167- global $db;
168- $sql = "INSERT INTO " . table_prefix . "feed_link (feed_id, feed_field, pligg_field) VALUES(".$this->FeedLinkId.", '".$this->FeedLinkField."', '".$this->FeedLinkPligg."');";
169- echo "<HR>" . $sql . "<HR>";
170- $db->query($sql);
171- }
172-
173- function drop_field_link(){
174- global $db;
175- $sql = "Delete from " . table_prefix . "feed_link where feed_link_id = ".$this->FeedLinkId.";";
176- //echo "<HR>" . $sql . "<HR>";
177- $db->query($sql);
178- }
179-
180-}
181-
182-?>
--- pligg/trunk/pligg/rss_import_init.php (revision 37)
+++ pligg/trunk/pligg/rss_import_init.php (nonexistent)
@@ -1,33 +0,0 @@
1-<?php
2-if(defined('mnminclude')){
3- include_once('rss_import_settings.php');
4-
5- // tell pligg what pages this modules should be included in
6- // pages are <script name> minus .php
7- // index.php becomes 'index' and upcoming.php becomes 'upcoming'
8- $do_not_include_in_pages = array();
9-
10- $include_in_pages = array('all');
11- if( do_we_load_module() ) {
12- // add the rss_import menu options for admin
13- module_add_action_tpl('tpl_header_admin_main_links', rss_import_tpl_path . 'rss_import_admin_main_link.tpl');
14- }
15-
16-
17- $include_in_pages = array('module');
18- if( do_we_load_module() ) {
19-
20- $moduleName = $_REQUEST['module'];
21-
22- if($moduleName == 'rss_import'){
23- module_add_action('module_page', 'rss_import_showpage', '');
24- include_once(mnmmodules . 'rss_import/rss_import_main.php');
25- }
26-
27- if($moduleName == 'rss_import_do_import'){
28- module_add_action('module_page', 'rss_import_do_import', '');
29- include_once(mnmmodules . 'rss_import/rss_import_main.php');
30- }
31- }
32-}
33-?>
\ No newline at end of file
--- pligg/trunk/pligg/create_feed_tables.php (revision 37)
+++ pligg/trunk/pligg/create_feed_tables.php (nonexistent)
@@ -1,97 +0,0 @@
1-<?php
2- include_once('config.php');
3- global $db;
4-
5- $sql = 'DROP TABLE IF EXISTS `' . table_prefix . 'feed_import_fields`;';
6- $db->query($sql);
7-
8- $sql = "CREATE TABLE `" . table_prefix . "feed_import_fields` (
9- `id` int(11) NOT NULL auto_increment,
10- `field_name` varchar(255) NOT NULL,
11- PRIMARY KEY (`id`)
12- ) TYPE = MyISAM;";
13- echo 'Creating table: \'feed_import_fields\'....<br />';
14- $db->query($sql);
15-
16-
17-
18- $sql = 'DROP TABLE IF EXISTS `' . table_prefix . 'feed_link`;';
19- $db->query($sql);
20-
21- $sql = "CREATE TABLE `" . table_prefix . "feed_link` (
22- `feed_link_id` int(11) NOT NULL auto_increment,
23- `feed_id` int(11) NOT NULL,
24- `feed_field` varchar(255) NOT NULL,
25- `pligg_field` varchar(255) NOT NULL,
26- PRIMARY KEY (`feed_link_id`)
27- ) TYPE = MyISAM;";
28- echo 'Creating table: \'feed_link\'....<br />';
29- $db->query($sql);
30-
31-
32-
33- $sql = 'DROP TABLE IF EXISTS `' . table_prefix . 'feeds`;';
34- $db->query($sql);
35-
36- $sql = "CREATE TABLE `" . table_prefix . "feeds` (
37- `feed_id` int(11) NOT NULL auto_increment,
38- `feed_name` varchar(255) NOT NULL,
39- `feed_url` varchar(255) NOT NULL,
40- `feed_freq_hours` int(11) NOT NULL default '12',
41- `feed_votes` int(11) NOT NULL default '1',
42- `feed_submitter` int(11) NOT NULL default '1',
43- `feed_item_limit` int(11) NOT NULL default '1',
44- `feed_category` int(11) NOT NULL default '1',
45- `feed_url_dupe` int(11) NOT NULL default '0',
46- `feed_title_dupe` int(11) NOT NULL default '0',
47- `feed_status` varchar(255) NOT NULL default 'queued',
48- `feed_last_check` timestamp NOT NULL,
49- PRIMARY KEY (`feed_id`)
50- ) TYPE = MyISAM;";
51- echo 'Creating table: \'feeds\'....<br />';
52- $db->query($sql);
53-
54-
55-
56- $sql = "Insert into `" . table_prefix . "feed_import_fields` (`id`,`field_name`) values ('1','link_url');";
57- $db->query($sql);
58- $sql = "Insert into `" . table_prefix . "feed_import_fields` (`id`,`field_name`) values ('2','link_title');";
59- $db->query($sql);
60- $sql = "Insert into `" . table_prefix . "feed_import_fields` (`id`,`field_name`) values ('3','link_content');";
61- $db->query($sql);
62- $sql = "Insert into `" . table_prefix . "feed_import_fields` (`id`,`field_name`) values ('4','link_tags');";
63- $db->query($sql);
64- $sql = "Insert into `" . table_prefix . "feed_import_fields` (`id`,`field_name`) values ('5','link_field1');";
65- $db->query($sql);
66- $sql = "Insert into `" . table_prefix . "feed_import_fields` (`id`,`field_name`) values ('6','link_field2');";
67- $db->query($sql);
68- $sql = "Insert into `" . table_prefix . "feed_import_fields` (`id`,`field_name`) values ('7','link_field3');";
69- $db->query($sql);
70- $sql = "Insert into `" . table_prefix . "feed_import_fields` (`id`,`field_name`) values ('8','link_field4');";
71- $db->query($sql);
72- $sql = "Insert into `" . table_prefix . "feed_import_fields` (`id`,`field_name`) values ('9','link_field5');";
73- $db->query($sql);
74- $sql = "Insert into `" . table_prefix . "feed_import_fields` (`id`,`field_name`) values ('10','link_field6');";
75- $db->query($sql);
76- $sql = "Insert into `" . table_prefix . "feed_import_fields` (`id`,`field_name`) values ('11','link_field7');";
77- $db->query($sql);
78- $sql = "Insert into `" . table_prefix . "feed_import_fields` (`id`,`field_name`) values ('12','link_field8');";
79- $db->query($sql);
80- $sql = "Insert into `" . table_prefix . "feed_import_fields` (`id`,`field_name`) values ('13','link_field9');";
81- $db->query($sql);
82- $sql = "Insert into `" . table_prefix . "feed_import_fields` (`id`,`field_name`) values ('14','link_field10');";
83- $db->query($sql);
84- $sql = "Insert into `" . table_prefix . "feed_import_fields` (`id`,`field_name`) values ('15','link_field11');";
85- $db->query($sql);
86- $sql = "Insert into `" . table_prefix . "feed_import_fields` (`id`,`field_name`) values ('16','link_field12');";
87- $db->query($sql);
88- $sql = "Insert into `" . table_prefix . "feed_import_fields` (`id`,`field_name`) values ('17','link_field13');";
89- $db->query($sql);
90- $sql = "Insert into `" . table_prefix . "feed_import_fields` (`id`,`field_name`) values ('18','link_field14');";
91- $db->query($sql);
92- $sql = "Insert into `" . table_prefix . "feed_import_fields` (`id`,`field_name`) values ('19','link_field15');";
93- $db->query($sql);
94-
95-?>
96-<hr />
97-If there were no errors then we're done!
--- pligg/trunk/pligg/admin_rss_import.php (revision 37)
+++ pligg/trunk/pligg/admin_rss_import.php (nonexistent)
@@ -1,33 +0,0 @@
1-<?php
2-// The source code packaged with this file is Free Software, Copyright (C) 2005 by
3-// The Pligg Team <pligger at pligg dot com>.
4-// It's licensed under the AFFERO GENERAL PUBLIC LICENSE unless stated otherwise.
5-// You can get copies of the licenses here:
6-// http://www.affero.org/oagpl.html
7-// AFFERO GENERAL PUBLIC LICENSE is also included in the file called "COPYING".
8-
9-include_once('Smarty.class.php');
10-$main_smarty = new Smarty;
11-
12-require('class.rssimport.php');
13-require_once('3rdparty/magpierss/rss_fetch.inc');
14-
15-define('MAGPIE_CACHE_DIR', 'cache/templates_c/');
16-
17-// breadcrumbs and page title
18-$navwhere['text1'] = $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel');
19-$navwhere['link1'] = getmyurl('admin', '');
20-$navwhere['text2'] = $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel_RSSImport');
21-$navwhere['link2'] = $my_pligg_base . '/admin_rss.php';
22-$navwhere['text3'] = $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel_RSSImport_Feeds');
23-$main_smarty->assign('navbar_where', $navwhere);
24-$main_smarty->assign('posttitle', ' / ' . $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel_RSSImport'));
25-
26-// sidebar
27-$main_smarty = do_sidebar($main_smarty);
28-
29-// show the template
30-$main_smarty->assign('tpl_center', $the_template . '/admin_templates/import_fields_center');
31-$main_smarty->display($the_template . '/pligg.tpl');
32-
33-?>
--- pligg/trunk/pligg/rss_import_install.php (revision 37)
+++ pligg/trunk/pligg/rss_import_install.php (nonexistent)
@@ -1,75 +0,0 @@
1-<?php
2- $module_info['name'] = 'RSS Importer';
3- $module_info['desc'] = 'Import RSS Feeds as Posts';
4- $module_info['version'] = 0.7;
5-
6- $module_info['db_add_table'][]=array(
7- 'name' => table_prefix . "feed_import_fields",
8- 'sql' => "CREATE TABLE `" . table_prefix . "feed_import_fields` (
9- `id` int(11) NOT NULL auto_increment,
10- `field_name` varchar(255) NOT NULL,
11- PRIMARY KEY (`id`)
12- ) TYPE = MyISAM;");
13-
14- $module_info['db_add_table'][]=array(
15- 'name' => table_prefix . "feed_link",
16- 'sql' => "CREATE TABLE `" . table_prefix . "feed_link` (
17- `feed_link_id` int(11) NOT NULL auto_increment,
18- `feed_id` int(11) NOT NULL,
19- `feed_field` varchar(255) NOT NULL,
20- `pligg_field` varchar(255) NOT NULL,
21- PRIMARY KEY (`feed_link_id`)
22- ) TYPE = MyISAM;");
23-
24- $module_info['db_add_table'][]=array(
25- 'name' => table_prefix . "feeds",
26- 'sql' => "CREATE TABLE `" . table_prefix . "feeds` (
27- `feed_id` int(11) NOT NULL auto_increment,
28- `feed_name` varchar(255) NOT NULL,
29- `feed_url` varchar(255) NOT NULL,
30- `feed_freq_hours` int(11) NOT NULL default '12',
31- `feed_votes` int(11) NOT NULL default '1',
32- `feed_submitter` int(11) NOT NULL default '1',
33- `feed_item_limit` int(11) NOT NULL default '1',
34- `feed_category` int(11) NOT NULL default '1',
35- `feed_url_dupe` int(11) NOT NULL default '0',
36- `feed_title_dupe` int(11) NOT NULL default '0',
37- `feed_status` varchar(255) NOT NULL default 'queued',
38- `feed_last_check` timestamp NOT NULL,
39- PRIMARY KEY (`feed_id`)
40- ) TYPE = MyISAM;");
41-
42- // these are seperate because most people will have the tables already
43- // created from a previous install
44-
45- $module_info['db_add_field'][]=array(table_prefix . 'feeds', 'feed_random_vote_enable', 'TINYINT', 3, "UNSIGNED", 0, '0');
46- $module_info['db_add_field'][]=array(table_prefix . 'feeds', 'feed_random_vote_min', 'TINYINT', 3, "UNSIGNED", 0, '5');
47- $module_info['db_add_field'][]=array(table_prefix . 'feeds', 'feed_random_vote_max', 'TINYINT', 3, "UNSIGNED", 0, '20');
48- $module_info['db_add_field'][]=array(table_prefix . 'feeds', 'feed_last_item_first', 'TINYINT', 3, "UNSIGNED", 0, '1');
49-
50- // the 'on duplicate' is just a cheap hack to prevent any errors if the
51- // module is 'installed' more than once.
52- // prevents -- Warning: Duplicate entry '1' for key 1 -- and so on
53- $module_info['db_sql'][] = "DELETE FROM `" . table_prefix . "feed_import_fields`;";
54- $module_info['db_sql'][] = "Insert into `" . table_prefix . "feed_import_fields` (`id`,`field_name`) values ('1','link_url');";
55- $module_info['db_sql'][] = "Insert into `" . table_prefix . "feed_import_fields` (`id`,`field_name`) values ('2','link_title');";
56- $module_info['db_sql'][] = "Insert into `" . table_prefix . "feed_import_fields` (`id`,`field_name`) values ('3','link_content');";
57- $module_info['db_sql'][] = "Insert into `" . table_prefix . "feed_import_fields` (`id`,`field_name`) values ('4','link_tags');";
58- $module_info['db_sql'][] = "Insert into `" . table_prefix . "feed_import_fields` (`id`,`field_name`) values ('5','link_field1');";
59- $module_info['db_sql'][] = "Insert into `" . table_prefix . "feed_import_fields` (`id`,`field_name`) values ('6','link_field2');";
60- $module_info['db_sql'][] = "Insert into `" . table_prefix . "feed_import_fields` (`id`,`field_name`) values ('7','link_field3');";
61- $module_info['db_sql'][] = "Insert into `" . table_prefix . "feed_import_fields` (`id`,`field_name`) values ('8','link_field4');";
62- $module_info['db_sql'][] = "Insert into `" . table_prefix . "feed_import_fields` (`id`,`field_name`) values ('9','link_field5');";
63- $module_info['db_sql'][] = "Insert into `" . table_prefix . "feed_import_fields` (`id`,`field_name`) values ('10','link_field6');";
64- $module_info['db_sql'][] = "Insert into `" . table_prefix . "feed_import_fields` (`id`,`field_name`) values ('11','link_field7');";
65- $module_info['db_sql'][] = "Insert into `" . table_prefix . "feed_import_fields` (`id`,`field_name`) values ('12','link_field8');";
66- $module_info['db_sql'][] = "Insert into `" . table_prefix . "feed_import_fields` (`id`,`field_name`) values ('13','link_field9');";
67- $module_info['db_sql'][] = "Insert into `" . table_prefix . "feed_import_fields` (`id`,`field_name`) values ('14','link_field10');";
68- $module_info['db_sql'][] = "Insert into `" . table_prefix . "feed_import_fields` (`id`,`field_name`) values ('15','link_field11');";
69- $module_info['db_sql'][] = "Insert into `" . table_prefix . "feed_import_fields` (`id`,`field_name`) values ('16','link_field12');";
70- $module_info['db_sql'][] = "Insert into `" . table_prefix . "feed_import_fields` (`id`,`field_name`) values ('17','link_field13');";
71- $module_info['db_sql'][] = "Insert into `" . table_prefix . "feed_import_fields` (`id`,`field_name`) values ('18','link_field14');";
72- $module_info['db_sql'][] = "Insert into `" . table_prefix . "feed_import_fields` (`id`,`field_name`) values ('19','link_field15');";
73-
74-
75-?>
--- pligg/trunk/pligg/modules/rss_import/rss_import_init.php (revision 37)
+++ pligg/trunk/pligg/modules/rss_import/rss_import_init.php (revision 38)
@@ -11,6 +11,7 @@
1111 if( do_we_load_module() ) {
1212 // add the rss_import menu options for admin
1313 module_add_action_tpl('tpl_header_admin_main_links', rss_import_tpl_path . 'rss_import_admin_main_link.tpl');
14+ module_add_action_tpl('tpl_header_admin_links', rss_import_tpl_path . 'rss_import_admin_link.tpl');
1415 }
1516
1617
--- pligg/trunk/pligg/modules/rss_import/rss_import_main.php (revision 37)
+++ pligg/trunk/pligg/modules/rss_import/rss_import_main.php (revision 38)
@@ -354,8 +354,14 @@
354354 //$url = "http://localhost/nik.xml";
355355 $feed_url = $db->get_var("select feed_url from " . table_prefix . "feeds where feed_id = " . $params['feed_id']);
356356 $rss = fetch_rss($feed_url);
357- $x = sizeof($rss->items[0]);
358- $z = $rss->items[0];
357+ $items0 = array();
358+ foreach ($rss->items as $item) {
359+ foreach ($item as $name => $val) {
360+ $items0[$name] = $val;
361+ }
362+ }
363+ $x = sizeof($items0);
364+ $z = $items0;
359365
360366 $TheTextToReturn = " options: {";
361367
@@ -364,7 +370,7 @@
364370 if ($count < $x){
365371 if (is_array($z[$item])) {
366372 foreach ($z[$item] as $item2 => $key) {
367- if($count > 0){$TheTextToReturn .= ", ";}
373+ if($count > -1){$TheTextToReturn .= ", ";}
368374 $TheTextToReturn .= $item . "_ne_st_ed_" . $item2 . ": '" . $item . " : " . $item2 . "'";
369375 $count = $count + 1;
370376 }
--- pligg/trunk/pligg/templates/wistie/css/style.css (revision 37)
+++ pligg/trunk/pligg/templates/wistie/css/style.css (revision 38)
@@ -329,7 +329,15 @@
329329 float:right;
330330 }
331331
332-
332+.commenttools span.comment_votes,
333+.commenttools span.ratebuttons {
334+font-size:1.5em;
335+}
336+.commenttools span.ratebuttons a {
337+border:1px solid black;
338+padding:0.2em 0.5em;
339+margin-left:0.5em;
340+}
333341 /* MIDDLE COLUMN */
334342 #midcol {
335343 width: 220px;
--- pligg/trunk/pligg/templates/xmlhttp.php (revision 37)
+++ pligg/trunk/pligg/templates/xmlhttp.php (revision 38)
@@ -210,21 +210,21 @@
210210 mnmxmlhttp[htmlid].setRequestHeader ('Content-Type', 'application/x-www-form-urlencoded');
211211 mnmxmlhttp[htmlid].send (mycontent);
212212 errormatch = new RegExp ("^ERROR:");
213- target1 = document.getElementById ('cvote-' + htmlid);
214- mnmPrevColor[htmlid] = target1.style.backgroundColor;
215- target1.style.backgroundColor = '#FFFFFF';
213+ //target1 = document.getElementById ('cvote-' + htmlid);
214+ //mnmPrevColor[htmlid] = target1.style.backgroundColor;
215+ //target1.style.backgroundColor = '#FFFFFF';
216216 mnmxmlhttp[htmlid].onreadystatechange = function () {
217217 if (mnmxmlhttp[htmlid].readyState == 4) {
218218 xvotesString[htmlid] = mnmxmlhttp[htmlid].responseText;
219219 if (xvotesString[htmlid].match (errormatch)) {
220220 xvotesString[htmlid] = xvotesString[htmlid].substring (6, xvotesString[htmlid].length);
221- changecvotevalues (htmlid, true);
221+ changecvotevalues (htmlid, true, value);
222222 } else {
223223 target1 = document.getElementById ('ratebuttons-' + id);
224224 target1.style.display = "none";
225- target2 = document.getElementById ('ratetext-' + id);
226- target2.innerHTML = "<?php echo $PLIGG_Visual_Comment_ThankYou_Rating;?>";
227- changecvotevalues (htmlid, false);
225+ //target2 = document.getElementById ('ratetext-' + id);
226+ //target2.innerHTML = "<?php echo $PLIGG_Visual_Comment_ThankYou_Rating;?>";
227+ changecvotevalues (htmlid, false, value);
228228 }
229229 }
230230 }
@@ -258,17 +258,23 @@
258258 return false;
259259 }
260260
261-function changecvotevalues (id, error)
261+function changecvotevalues (id, error, value)
262262 {
263263 split = new RegExp ("~--~");
264- b = xvotesString[id].split (split);
265- target1 = document.getElementById ('cvote-' + id);
264+ b = xvotesString[id].split (split);
265+ target1 = document.getElementById ('comment_content-' + id);
266+ target2 = document.getElementById ('comment_votes-' + id);
266267 if (error) {
267268 return false;
268269 }
269270 if (b.length <= 3) {
270- target1.innerHTML = b[0];
271- target1.style.backgroundColor = mnmPrevColor[id];
271+ target2.innerHTML = b[0];
272+ //target1.style.backgroundColor = mnmPrevColor[id];
273+ if (b[0] == -1 && value < 0) {
274+ new Effect.Opacity(target1, {duration:0.8, from:1.0, to:0.3});
275+ } else if (b[0] == 0 && value > 0) {
276+ new Effect.Opacity(target1, {duration:0.8, from:0.3, to:1.0});
277+ }
272278 }
273279 return false;
274280 }
@@ -389,3 +395,16 @@
389395 }
390396 }
391397 }
398+
399+function show_hide_user_links(thediv)
400+{
401+ if(window.Effect){
402+ if(thediv.style.display == 'none')
403+ {Effect.Appear(thediv); return false;}
404+ else
405+ {Effect.Fade(thediv); return false;}
406+ }else{
407+ var replydisplay=thediv.style.display ? '' : 'none';
408+ thediv.style.display = replydisplay;
409+ }
410+}
\ No newline at end of file
Show on old repository browser