removing constants from code
authorniekt0 <niekt0@kyberia.cz>
Sat, 18 Dec 2010 15:34:24 +0000 (16:34 +0100)
committerniekt0 <niekt0@kyberia.cz>
Sat, 18 Dec 2010 15:34:24 +0000 (16:34 +0100)
doc/TODO
trash/masterize.inc [moved from wwwroot/inc/eventz/masterize.inc with 100% similarity]
wwwroot/inc/eventz/K.inc
wwwroot/inc/eventz/bookmarks.inc
wwwroot/inc/rssparse.php
wwwroot/inc/senate.inc
wwwroot/inc/smarty/node_methodz/function.get_search.php.BAK [deleted file]
wwwroot/inc/smarty/node_methodz/function.merge_arrays.php
wwwroot/inc/smarty/node_methodz/function.testm.php [deleted file]

index 062b57acc5835f14f246e986af07c45444fe7f74..da4014826e8deee1baa2f0a48b89002aca417d11 100644 (file)
--- a/doc/TODO
+++ b/doc/TODO
@@ -1,10 +1,9 @@
+- remove hard-coded constants (everywhere):
+
 - Registration process -> Add welcome texts & move them to one file/node
-  Temporary requests node does not exists.
-  Nodes are created with bad vector
-  (during registration we should generate GnuPG keypair 
+  +(during registration we should generate GnuPG keypair 
    to user_gpg_prv and user_gpg_pub fields in table users) (harvie)
 
-
 - User mail -> can't delete the mails...
   Anyway move whole mail handling out of nodes.php (?)
 
@@ -48,7 +47,7 @@
 
 - keep fixing XSS
 
-- Test & scale logarithmic threading
+- Fix defaukt template (big tables)
 
 - Remove templates from git (they should be only in sql)
 
index b954bc4ed502052958b35eb883ac3892b7210587..8a5aca46578437734adf0b89698db39e26973dbc 100644 (file)
@@ -56,6 +56,7 @@ function K() {
     $kset->next();
     $user_k=$kset->getString('user_k');
 
+    // XXX hard coded
     $senat_id = 876611;
     $K_id     = 1961061;
     $comms    = getCommanders($K_id);
index 0a20be51d6e4e2e7837ad0382f9d2c291e929476..06bdd756f816d04e12427d2c793171b89ccf9430 100644 (file)
@@ -8,7 +8,7 @@
 <td valign='top' width=50%>
 
 <!-- BANNER PLACE START -->
-<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' width='468' height='60'><param name='movie' value='http://www.subclub.sk/images/banners/milkshake468x60.swf'><param name='quality' value='high'><embed src='http://www.subclub.sk/images/banners/milkshake468x60.swf' quality=high width='468' height='60' type='application/x-shockwave-flash' pluginspace='http://www.macromedia.com/go/getflashplayer'></embed></object>
+
 <!-- BANNER PLACE END -->
 <form method='post' action='/id/{$node.node_id}'>
 
index 1ebb4dbda2ae353b6f49c18b28d50e2dc53c8644..5d342a8bd67e1de04c9e129d33225a679bd272a0 100644 (file)
@@ -11,6 +11,7 @@ $rss->cache_dir = './cache';
 $rss->cache_time = 3600; // one hour
 
 // load some RSS file
+// XXX
 if ($rs = $rss->get('http://h-k.sk/scripts/google2rss.php?num=15&q=smallpox')) {
 
 print_r($rs);
index b417173672475edd4f3358c2babeb20275259ba9..11820734592616e18203642ecc946e230c19df72 100644 (file)
@@ -1,4 +1,76 @@
 <?php
 define('DAILY_K',30);
 define('REGISTRATION_VOTES',2); //too small so far
+
+// An attempt to remove hard-code constants from code
+define('REGISTRATION_REQUEST_NODE',2091448);
+define('UNVERIFIED_REGISTRATIONS_NODE',1836516);
+
+// 1961061 citizens?
+// 1061495 citizens?
+// 1961070 citizens?
+
+// 791946 ps.php
+// 2228983 ps.php
+
+// 2019721 nodes.php template
+// 2091520 -||-
+
+// F.inc, K.inc
+// $senat_id = 876611;
+// $K_id = 1961061;
+
+// addEvent.inc
+//    $params['node_parent'] = 2019771;
+
+// addPlugin.inc
+//    $params['node_parent'] = 2019772;
+
+// addTemplate.inc
+//    $params['node_parent'] = 2029360;
+
+// configurePoll.inc
+//$params['template_id']="1549834";
+
+// delete.inc
+// $new_parent_id=123456;
+
+// login.inc
+//    elseif ($set->getString('header_id') == 2091520) {
+
+// masterize.inc 
+// moved to trash
+
+// remove_users.inc 
+// a lot of different
+
+// unfriend.inc
+// $q = "update nodes set external_link='', node_parent=123456, node_vector='001234560$node_id' whe
+
+// uprav_zaregistrovanych.inc
+//  node_parent=2091448 and k>=3
+
+// verify.inc
+// node_parent=1836516")
+// $q="update nodes set node_parent=2091448, 
+// node_vector='0000010120914480$userid' where node_id='$user
+
+// vycisti_registracky.inc
+// node_parent=2091448 and k<=4
+// $q="delete from nodes where node_vector like '020914480$noda%'";
+
+// resource.kyberia.php
+// $params['node_parent'] = 2029360;
+
+// node methodz detto, (add*)
+
+// get_citizen_count.inc
+// nodes.node_id=1961061
+
+// get_k_filtred_nodes
+// $node_id = 2472165;
+
+// get_poll.php
+// template_id='1549834
+
 ?>
diff --git a/wwwroot/inc/smarty/node_methodz/function.get_search.php.BAK b/wwwroot/inc/smarty/node_methodz/function.get_search.php.BAK
deleted file mode 100644 (file)
index 6546aa2..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-<?php
-function smarty_function_get_search($params,&$smarty) {
-/*
-$string=escapeshellarg($params['query']);
-$output=`/usr/local/bin/swish-e -d ::: -p node_name node_id node_type node_content k node_views -s node_views -f
-/storage/data/index.swish-e -w node_name=($string) or node_content=($string)`;
-//$output2=`/usr/local/bin/swish-e -d ::: -p node_name node_id node_type node_content k node_views -s node_views -f
-/storage/data/index.swish-e -w '$string'`;
-//echo "/usr/local/bin/swish-e -d ::: -p node_name node_id node_type node_content k node_views -s node_views -f
-/storage/data/index.swish-e -w $string";
-//$output=$output1.$output2;
-$output=str_replace($params['query'],"<span
-class='most_important'>".$params['query']."</span>",$output);
-preg_match_all("/:::(.*?):::(.*?):::(.*?):::(.*?):::(.*?):::(.*?):::(.*?):::(.*?):::(.*?)n/i",$output,$matches);
-foreach($matches[0] as $key => $value) {
-preg_match("/(.*?).xml/i",$matches[2][$key],$ids);
-$id=$ids[1];
-echo "<a href='/id/".$id."'>".$matches[4][$key]."</a>
-(".$matches[6][$key].")<br>";
-echo $matches[7][$key]."<br><br>";
-//echo $matches[5][$key]."<br><br>";
-}
-
-
-global $db, $node;
-
-$q = "SELECT * FROM nodes WHERE node_system_access!='private' AND template_id=3 AND node_name LIKE
-'%".
-str_replace(array("%", "_"), array('%', '_'),
-addslashes($params['query']))."%'";
-$set=$db->query($q);
-while($set->next()) {
-$rec = $set->getRecord();
-echo "<a href='/id/{$rec[node_id]}'>{$rec[node_name]}</a><br>";
-}
-*/
-global $db, $node;
-if (is_numeric($params['offset'])) $offset = $params['offset'];
-else $offset = 0;
-
-if (is_numeric($params['listing_amount'])) $listing_amount = $params['listing_amount'];
-else $listing_amount = 32;
-$query = addslashes($params['query']);
-$q = "select users.login, nodes.* from nodes left join users on
- users.user_id = nodes.node_creator where node_name like '$query%'";
-$set = $db->query($q);
-while ($set->next()) {
-    $array[] = $set->getRecord();
-}
-$smarty->assign('get_search_short',$array);
-
-if ($_POST['orderby'] != ("k" || "node_created" || "probability" ||
-"node_views")) $orderby = "k";
-else $orderby=$_POST['orderby'];
-
-$q = "select users.login as login, users.*, nodes.*, nodes.node_creator,
- node_content, match (node_content.node_content) against ('$query') as
- probability from node_content left join users on node_content.node_id = users.user_id
- left join nodes on node_content.node_id = nodes.node_id where
- node_system_access!='private' and match (node_content.node_content)
- against ('$query') order by $orderby desc limit $offset,$listing_amount";
-
-$set = $db->query($q);
-while ($set->next()) {
-    $search[] = $set->getRecord();
-}
-
-$smarty->assign('get_search',$search);
-}
-?>
\ No newline at end of file
index 63991f00c695eaed8abe565ee6196a8c932ff89a..e7320d2742fe0f4dab3c71e204243d97276ed326 100644 (file)
 
                $array=array_merge($array1,$array2);
 
-               /*
-               if ($_SESSION['user_id']==548) {
-                       print_r($array1);
-                       echo "LALALA";
-                       print_r($array2);
-                       echo "AAAAAA";
-                       print_r($array);
-               }
-               */
-
                if ($sort_by=='thread') {
                        $i=0;
                         for($i=0; $i<count($array); $i++){
@@ -55,9 +45,7 @@
                }
 
 
-//             if ($_SESSION['user_id']==548) print_r($array);
-
                $smarty->assign('merged',$array);
 
        }
-?>
\ No newline at end of file
+?>
diff --git a/wwwroot/inc/smarty/node_methodz/function.testm.php b/wwwroot/inc/smarty/node_methodz/function.testm.php
deleted file mode 100644 (file)
index d26fd61..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-<?php
-
-function smarty_function_testm($params,&$smarty) {
-
-if ($params['orderby']=='desc') $orderby="desc";
-
-//$external_link=$params['external_link'];
-$external_link='event://';
-if ($params['listing_amount']=='all')
-$listing_amount='23232323232323323';
-else $listing_amount=$params['listing_amount'];
-
-if (empty($params['offset'])) $offset=0;
-else $offset=$params['offset'];
-
-global $db,$node;
-//if (!$params['parent_id']) {
-$parent_id=$node['node_id'];
-//}
-//else $parent_id=$params['parent_id'];
-
-$user_id=$_SESSION['user_id'];
-
-$q="select users.*,nodes.*,node_content.* from nodes  left join
-node_content on (node_content.node_id=nodes.node_id) left
-join users on users.user_id=nodes.node_creator where external_link like '$external_link%' LIMIT 0,322323232323232323";
-
-$set=$db->query($q);
-while ($set->next()) $pole[]=$set->getRecord();
-$smarty->assign('testm',$pole);
-}
-?>
\ No newline at end of file
This page took 0.257166 seconds and 4 git commands to generate.