Changeset 210

Show
Ignore:
Timestamp:
07/04/06 18:25:59 (2 years ago)
Author:
lekeno
Message:

smarty caching (newer templates on the way)
cleanup hard coded strings
cleanup forgotten url rewriting
cleanup title management (newer templates on the way)
cleanup error pages handling
added 403 404 pages
added common_elements.php for smarty caching
bug fixes (tags in edit meme, folksonomy font size...)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/public_html/.htaccess

    r168 r210  
    1010RewriteRule ^votes/(.*) /profile.php?user_name=$1&view=v 
    1111RewriteRule ^comments/(.*) /profile.php?user_name=$1&view=c 
    12  
     12RewriteRule ^send-meme/(.*) /sendlink.php?meme_id=$1 
     13RewriteRule ^edit-meme/(.*) /edit_meme.php?meme_id=$1 
     14RewriteRule ^edit-profile/(.*) /profile_edit.php?user_id=$1 
     15RewriteRule ^tag-meme/(.*) /tag_meme.php?meme_id=$1 
     16 
     17 
     18 
     19ErrorDocument 404 /404.php 
     20ErrorDocument 403 /403.php 
     21 
     22# No PHPSESSION appended to the URL 
     23php_value session.use_only_cookies 1  
     24php_value session.use_trans_sid    0 
     25 
     26#php_value mbstring.http_input auto 
     27#php_value mbstring.http_output UTF-8 
     28#php_value mbstring.internal_encoding UTF-8 
     29 
     30#bad guys or bots 
     31#bots 
     32#psycheclone range 
     33#deny from 208.66.195. 
     34#gigabot 
     35deny from 66.154.103.38 
     36#DOS ? 
     37deny from 220.150.190.74 
     38#trackback spammers 
     39deny from 217.10.190.36 
     40deny from 81.22.6.157 
     41#spammers tentant des trucs 200512 
     42deny from 84.233.133.71 
     43deny from 218.38.232.6 
     44deny from 202.152.35.149 
     45deny from 62.233.222.146 
     46deny from 61.19.223.134 
     47deny from 85.101.202.145 
     48deny from 203.162.27.195 
     49deny from 202.58.85.2 
     50deny from 210.178.65.93 
     51deny from 58.77.204.89 
     52deny from 200.79.192.23 
     53deny from 195.175.37.70 
     54deny from 196.7.0.160 
     55deny from 195.175.37.71 
     56deny from 203.131.197.195 
     57deny from 202.58.86.3 
     58deny from 58.239.137.157 
     59deny from 211.250.8.15 
     60deny from 202.58.85.6 
     61deny from 218.108.238.76 
     62deny from 59.11.45.73 
     63deny from 163.30.98.129 
     64deny from 164.58.72.226 
     65deny from 64.24.35.14 
     66deny from 221.3.235.96 
     67deny from 203.162.27.198 
     68deny from 203.162.27.196 
     69deny from 203.162.27.201 
     70deny from 200.68.241.78 
     71deny from 203.162.27.197 
     72deny from 203.162.27.200 
     73deny from 66.128.97.26 
     74deny from 203.162.27.199 
     75deny from 216.223.54.225 
     76deny from 83.104.96.225 
     77deny from 222.118.214.194 
     78deny from 210.113.112.120 
     79deny from 200.223.18.203 
     80deny from 222.109.214.130 
     81deny from 148.235.66.115 
     82deny from 195.175.37.6 
     83deny from 211.38.50.193 
     84deny from 211.57.95.253 
     85deny from 202.58.85.8 
     86deny from 200.79.192.26  
     87deny from 200.79.192.24 
     88deny from 220.123.231.11 
     89deny from 200.79.192.25 
     90deny from 203.106.3.173 
     91deny from 218.56.32.230 
     92deny from 58.147.0.35 
     93deny from 61.142.212.46 
     94deny from 193.109.91.134 
     95deny from 212.92.1.62 
     96deny from 201.55.106.180 
     97deny from 62.231.144.106 
     98#20060505 il insiste 
     99deny from 195.229.242.84 
     100deny from 200.118.2.220 
     101#spammers 
     102deny from 69.50.170.210 
     103deny from 69.157.86.100 
     104deny from 213.249.155.240 
     105# spammers alestra 
     106deny from 148.244.150.52 
     107deny from 148.244.150.58 
     108deny from 148.244.150.57 
     109deny from 207.248.240.119 
     110deny from 207.248.240.118 
     111deny from 210.128.142.42 
     112deny from 210.173.179.77 
     113deny from 148.244.104.238 
     114#spammer osru 
     115deny from 72.232.93.249 
     116 
     117#hackers 
     118deny from 212.138.47.21 
     119deny from 200.151.91.234 
     120deny from 212.138.113.12 
     121deny from 200.165.175.222 
     122deny from 63.208.120.224 
     123deny from 212.138.47.20 
     124deny from 201.8.70.191 
     125deny from 69.50.170.78 
     126deny from 200.165.238.28 
     127deny from 201.42.104.245 
     128deny from 213.171.218.188 
     129deny from 210.99.208.60 
     130 
     131#dokuwiki spammer 
     132deny from 85.98.154.47 
     133 
     134#shoutbox spammer 
     135deny from 12.140.228.99 
     136deny from 12.207.60.126 
     137deny from 12.210.118.228 
     138deny from 12.210.240.49 
     139deny from 12.221.125.240 
     140deny from 125.137.7.249 
     141deny from 125.189.148.43 
     142deny from 125.240.5.130 
     143deny from 125.240.113.194 
     144deny from 128.151.138.157 
     145deny from 130.13.73.89 
     146deny from 130.13.74.66 
     147deny from 130.15.225.193 
     148deny from 130.160.147.157 
     149deny from 132.248.97.214 
     150deny from 134.58.253.114 
     151deny from 153.5.69.73 
     152deny from 154.20.138.2 
     153deny from 157.181.162.4 
     154deny from 163.17.7.193 
     155deny from 165.228.128.11 
     156deny from 165.228.130.11 
     157deny from 165.228.130.12 
     158deny from 165.228.131.11 
     159deny from 165.228.132.11 
     160deny from 165.228.133.11 
     161deny from 172.145.8.161 
     162deny from 172.160.168.185 
     163deny from 172.163.34.108 
     164deny from 172.165.155.47 
     165deny from 172.166.17.11 
     166deny from 172.181.23.92 
     167deny from 172.205.168.0 
     168deny from 193.251.135.124 
     169deny from 194.154.22.35 
     170deny from 194.154.22.37 
     171deny from 196.40.26.254 
     172deny from 196.40.43.74 
     173deny from 198.174.3.116 
     174deny from 198.30.36.4 
     175deny from 200.118.87.163 
     176deny from 200.175.154.246 
     177deny from 200.204.121.139 
     178deny from 200.209.90.130 
     179deny from 200.211.70.65 
     180deny from 200.233.199.18 
     181deny from 200.31.195.35 
     182deny from 200.76.36.195 
     183deny from 200.77.212.61 
     184deny from 200.84.189.3 
     185deny from 201.17.197.7 
     186deny from 201.209.246.36 
     187deny from 201.245.239.185 
     188deny from 201.248.133.176 
     189deny from 201.252.115.218 
     190deny from 201.252.79.186 
     191deny from 202.56.253.183 
     192deny from 202.67.46.69 
     193deny from 202.7.166.166 
     194deny from 203.160.1.39 
     195deny from 203.160.1.45 
     196deny from 203.172.209.99 
     197deny from 203.229.117.158 
     198deny from 203.246.84.32 
     199deny from 205.237.144.7 
     200deny from 205.250.50.146 
     201deny from 206.74.96.30 
     202deny from 207.172.237.117 
     203deny from 207.255.199.169 
     204deny from 209.7.140.14 
     205deny from 210.105.128.92 
     206deny from 210.110.86.77 
     207deny from 210.245.96.26 
     208deny from 210.71.187.53 
     209deny from 210.96.248.136 
     210deny from 211.169.61.54 
     211deny from 211.223.53.55 
     212deny from 211.38.193.214 
     213deny from 211.41.207.237 
     214deny from 211.48.109.93 
     215deny from 212.104.99.32 
     216deny from 212.138.113.13 
     217deny from 212.138.113.16 
     218deny from 212.138.47.14 
     219deny from 212.138.47.15 
     220deny from 212.138.47.17 
     221deny from 212.138.47.18 
     222deny from 212.138.47.22 
     223deny from 212.138.47.23 
     224deny from 212.138.47.29 
     225deny from 212.175.113.58 
     226deny from 212.77.192.61 
     227deny from 212.77.192.62 
     228deny from 212.87.125.58 
     229deny from 213.103.214.59 
     230deny from 213.164.107.173 
     231deny from 213.213.211.218 
     232deny from 213.60.58.198 
     233deny from 216.213.252.27 
     234deny from 216.230.156.138 
     235deny from 216.237.220.184 
     236deny from 216.51.189.172 
     237deny from 216.6.240.38 
     238deny from 216.63.174.45 
     239deny from 217.122.174.228 
     240deny from 217.125.102.71 
     241deny from 217.98.20.195 
     242deny from 217.98.20.20 
     243deny from 218.209.109.116 
     244deny from 218.235.75.13 
     245deny from 218.237.94.161 
     246deny from 218.37.27.219 
     247deny from 219.165.115.186 
     248deny from 219.94.87.123 
     249deny from 220.82.111.179 
     250deny from 220.89.225.219 
     251deny from 220.89.35.136 
     252deny from 221.147.17.151 
     253deny from 221.164.159.189 
     254deny from 221.30.46.32 
     255deny from 222.101.72.206 
     256deny from 222.104.39.101 
     257deny from 24.0.142.38 
     258deny from 24.107.194.175 
     259deny from 24.113.58.112 
     260deny from 24.119.234.4 
     261deny from 24.12.252.237 
     262deny from 24.125.18.217 
     263deny from 24.130.140.240 
     264deny from 24.14.24.176 
     265deny from 24.141.133.152 
     266deny from 24.148.178.230 
     267deny from 24.154.133.85 
     268deny from 24.154.136.156 
     269deny from 24.154.233.104 
     270deny from 24.154.233.177 
     271deny from 24.158.128.194 
     272deny from 24.165.255.75 
     273deny from 24.170.90.190 
     274deny from 24.176.14.69 
     275deny from 24.176.247.189 
     276deny from 24.176.69.242 
     277deny from 24.178.242.136 
     278deny from 24.178.79.66 
     279deny from 24.184.33.168 
     280deny from 24.184.98.123 
     281deny from 24.187.246.222 
     282deny from 24.188.71.56 
     283deny from 24.19.2.174 
     284deny from 24.191.96.110 
     285deny from 24.193.65.71 
     286deny from 24.207.78.137 
     287deny from 24.214.240.190 
     288deny from 24.222.23.131 
     289deny from 24.23.38.176 
     290deny from 24.231.15.186 
     291deny from 24.232.56.173 
     292deny from 24.236.223.31 
     293deny from 24.252.17.87 
     294deny from 24.253.74.248 
     295deny from 24.255.173.31 
     296deny from 24.255.203.22 
     297deny from 24.3.100.17 
     298deny from 24.3.157.23 
     299deny from 24.30.237.192 
     300deny from 24.37.179.235 
     301deny from 24.47.206.186 
     302deny from 24.56.166.246 
     303deny from 24.60.201.43 
     304deny from 24.92.147.73 
     305deny from 24.98.207.206 
     306deny from 24.98.245.24 
     307deny from 58.140.254.41 
     308deny from 58.227.159.213 
     309deny from 59.120.1.178 
     310deny from 61.243.34.102 
     311deny from 61.47.215.16 
     312deny from 61.79.141.221 
     313deny from 61.88.107.196 
     314deny from 61.92.76.240 
     315deny from 61.96.251.182 
     316deny from 61.99.13.185 
     317deny from 62.141.218.74 
     318deny from 62.16.137.200 
     319deny from 62.163.228.19 
     320deny from 62.194.52.167 
     321deny from 62.21.34.102 
     322deny from 62.238.200.13 
     323deny from 62.78.167.221 
     324deny from 62.90.126.179 
     325deny from 63.138.93.219 
     326deny from 64.110.74.244 
     327deny from 64.219.197.152 
     328deny from 64.33.194.168 
     329deny from 64.9.80.7 
     330deny from 65.172.145.192 
     331deny from 65.191.45.6 
     332deny from 65.42.94.126 
     333deny from 65.65.247.134 
     334deny from 65.96.222.145 
     335deny from 65.99.198.36 
     336deny from 66.128.32.7 
     337deny from 66.130.226.78 
     338deny from 66.131.125.133 
     339deny from 66.131.22.145 
     340deny from 66.158.237.168 
     341deny from 66.176.88.210 
     342deny from 66.207.198.98 
     343deny from 66.246.246.210 
     344deny from 66.30.86.91 
     345deny from 67.119.166.53 
     346deny from 67.160.224.39 
     347deny from 67.164.136.143 
     348deny from 67.165.64.54 
     349deny from 67.166.231.167 
     350deny from 67.168.143.204 
     351deny from 67.171.248.114 
     352deny from 67.173.183.199 
     353deny from 67.183.162.21 
     354deny from 67.184.87.104 
     355deny from 67.189.174.159 
     356deny from 67.66.76.101 
     357deny from 67.81.130.132 
     358deny from 67.81.80.246 
     359deny from 68.0.235.123 
     360deny from 68.11.66.162 
     361deny from 68.112.166.248 
     362deny from 68.12.170.122 
     363deny from 68.12.252.35 
     364deny from 68.13.122.108 
     365deny from 68.148.199.234 
     366deny from 68.176.125.45 
     367deny from 68.176.98.89 
     368deny from 68.179.130.48 
     369deny from 68.190.45.41 
     370deny from 68.194.31.138 
     371deny from 68.194.39.210 
     372deny from 68.196.29.12 
     373deny from 68.196.90.198 
     374deny from 68.203.247.23 
     375deny from 68.23.101.199 
     376deny from 68.230.77.218 
     377deny from 68.248.230.48 
     378deny from 68.250.246.115 
     379deny from 68.33.242.34 
     380deny from 68.35.211.128 
     381deny from 68.35.226.217 
     382deny from 68.36.70.9 
     383deny from 68.37.146.208 
     384deny from 68.37.227.187 
     385deny from 68.38.123.88 
     386deny from 68.40.229.115 
     387deny from 68.44.56.188 
     388deny from 68.45.119.141 
     389deny from 68.46.158.130 
     390deny from 68.50.207.132 
     391deny from 68.53.107.103 
     392deny from 68.55.227.158 
     393deny from 68.63.41.186 
     394deny from 68.65.176.186 
     395deny from 68.69.253.192 
     396deny from 68.80.68.246 
     397deny from 68.89.70.203 
     398deny from 68.90.194.129 
     399deny from 68.96.196.179 
     400deny from 69.10.103.250 
     401deny from 69.108.50.64 
     402deny from 69.111.188.73 
     403deny from 69.114.31.226 
     404deny from 69.118.185.72 
     405deny from 69.118.83.244 
     406deny from 69.119.131.91 
     407deny from 69.120.136.114 
     408deny from 69.120.92.143 
     409deny from 69.123.216.54 
     410deny from 69.136.36.188 
     411deny from 69.14.218.196 
     412deny from 69.140.178.210 
     413deny from 69.141.142.190 
     414deny from 69.141.33.1 
     415deny from 69.142.43.60 
     416deny from 69.143.196.188 
     417deny from 69.144.152.38 
     418deny from 69.165.152.100 
     419deny from 69.168.23.29 
     420deny from 69.195.220.6 
     421deny from 69.197.230.194 
     422deny from 69.199.200.96 
     423deny from 69.202.117.28 
     424deny from 69.203.122.171 
     425deny from 69.204.181.220 
     426deny from 69.210.59.154 
     427deny from 69.210.73.126 
     428deny from 69.225.45.27 
     429deny from 69.228.47.97 
     430deny from 69.230.99.142 
     431deny from 69.231.241.87 
     432deny from 69.236.244.86 
     433deny from 69.242.84.64 
     434deny from 69.246.105.146 
     435deny from 69.249.20.218 
     436deny from 69.254.245.27 
     437deny from 69.34.37.184 
     438deny from 69.76.159.148 
     439deny from 70.131.102.181 
     440deny from 70.134.126.185 
     441deny from 70.136.54.240 
     442deny from 70.160.102.101 
     443deny from 70.161.172.100 
     444deny from 70.162.122.240 
     445deny from 70.180.145.80 
     446deny from 70.182.112.5 
     447deny from 70.182.112.6 
     448deny from 70.187.223.243 
     449deny from 70.224.68.3 
     450deny from 70.224.89.206 
     451deny from 70.243.238.137 
     452deny from 70.243.30.141 
     453deny from 70.245.153.116 
     454deny from 70.248.179.193 
     455deny from 70.249.18.164 
     456deny from 70.249.245.209 
     457deny from 70.252.49.24 
     458deny from 70.252.50.33 
     459deny from 70.252.81.42 
     460deny from 70.29.102.59 
     461deny from 70.29.110.127 
     462deny from 70.31.22.45 
     463deny from 70.36.252.238 
     464deny from 70.37.81.197 
     465deny from 71.104.100.87 
     466deny from 71.104.51.205 
     467deny from 71.128.212.179 
     468deny from 71.130.237.141 
     469deny from 71.135.58.160 
     470deny from 71.139.3.173 
     471deny from 71.192.182.104 
     472deny from 71.199.11.215 
     473deny from 71.227.164.132 
     474deny from 71.65.74.29 
     475deny from 71.8.44.137 
     476deny from 71.82.208.228 
     477deny from 71.99.201.20 
     478deny from 72.130.91.124 
     479deny from 72.192.19.42 
     480deny from 72.23.110.118 
     481deny from 72.232.92.170 
     482deny from 72.240.140.242 
     483deny from 72.240.209.254 
     484deny from 72.4.166.195 
     485deny from 80.161.137.93 
     486deny from 80.218.241.226 
     487deny from 80.32.160.15 
     488deny from 80.32.253.120 
     489deny from 80.55.145.194 
     490deny from 81.11.176.226 
     491deny from 81.164.159.115 
     492deny from 81.165.228.111 
     493deny from 81.190.186.129 
     494deny from 81.203.121.165 
     495deny from 81.82.129.190 
     496deny from 81.83.13.218 
     497deny from 82.119.115.189 
     498deny from 82.155.155.195 
     499deny from 82.156.240.152 
     500deny from 82.181.36.190 
     501deny from 82.224.87.35 
     502deny from 82.233.83.67 
     503deny from 83.144.96.59 
     504deny from 83.144.97.225 
     505deny from 83.175.203.35 
     506deny from 83.22.48.108 
     507deny from 83.220.143.18 
     508deny from 83.25.226.245 
     509deny from 83.251.85.107 
     510deny from 83.253.101.5 
     511deny from 83.253.101.61 
     512deny from 83.26.12.162 
     513deny from 83.30.90.105 
     514deny from 83.31.29.14 
     515deny from 83.31.7.73 
     516deny from 83.42.11.8 
     517deny from 83.50.100.43 
     518deny from 83.6.213.56 
     519deny from 83.95.104.244 
     520deny from 84.120.3.248 
     521deny from 84.123.1.156 
     522deny from 84.192.38.53 
     523deny from 84.192.39.153 
     524deny from 84.30.214.112 
     525deny from 85.18.156.24 
     526deny from 85.224.173.236 
     527deny from 85.39.245.76 
     528deny from 85.64.211.113 
     529deny from 85.71.107.173 
     530deny from 85.92.235.22 
     531deny from 85.99.207.93 
     532deny from 87.231.37.7 
     533deny from 87.64.28.144 
     534deny from 88.3.204.208 
     535deny from 72.232.92.170 
  • trunk/public_html/about.php

    r60 r210  
    11<?php 
    22  include_once('akarru.lib/common.php'); 
     3   
     4  include_once('common_elements.php'); 
     5   
    36  $smarty->assign('content_title', $bl_about); 
    47  $smarty->assign('content', 'about'); 
     8  $smarty->assign('show_ads', showGGAds()); 
    59  $smarty->display('master_page.tpl'); 
    610?> 
  • trunk/public_html/admin.php

    r2 r210  
    33  include_once('akarru.lib/statistics.php'); 
    44  if ($bm_user != 1) { 
    5           header("Location: index.php"); 
     5      logerror("admin.php: bm_user not admin", "phpErrors"); 
     6          header("Location: /403.php"); 
    67          exit(); 
    78          return; 
    89  } 
     10   
     11  include_once('common_elements.php'); 
    912 
    10   $smarty->assign('content_title', 'administraci&oacute;n'); 
     13  $smarty->assign('content_title', $content_title_admin); 
    1114  $memes = new memes($bm_db, $bm_user, $bm_promo_level); 
    1215 
  • trunk/public_html/admin_categories.php

    r130 r210  
    22  include_once('akarru.lib/common.php'); 
    33  if ($bm_user != 1) { 
    4           header("Location: index.php"); 
     4      logerror("admin.php: bm_user not admin", "phpErrors"); 
     5          header("Location: /403.php"); 
    56          exit(); 
    67          return; 
    78  } 
     9   
     10  include_once('common_elements.php'); 
    811   
    912  $categories = new categories($bm_db); 
     
    2124            if ($categories->delete_category($cat_id)) 
    2225            { 
     26                $smarty->clear_cache(null,'db|categories'); 
    2327                header("Location: admin_categories.php"); 
    2428                exit(); 
     
    4549              if ($categories->edit_category($cat_id, $cat_name)) 
    4650              { 
     51                $smarty->clear_cache(null,'db|categories'); 
    4752                header("Location: admin_categories.php"); 
    4853                exit(); 
     
    6772            if ($categories->enable_category($cat_id)) 
    6873            { 
     74                $smarty->clear_cache(null,'db|categories'); 
    6975                header("Location: admin_categories.php"); 
    7076                exit(); 
     
    8288          } 
    8389      else if (!empty($_GET['disable'])) { 
    84                   // try to enable the category 
     90                  // try to disable the category 
    8591           
    8692          $cat_id = (int) $_GET['disable']; 
     
    8995            if ($categories->disable_category($cat_id)) 
    9096            { 
     97                $smarty->clear_cache(null,'db|categories'); 
    9198                header("Location: admin_categories.php"); 
    9299                exit(); 
  • trunk/public_html/admin_category.php

    r130 r210  
    22  include_once('akarru.lib/common.php'); 
    33  if ($bm_user != 1) { 
    4           header("Location: index.php"); 
     4          header("Location: /403.php"); 
    55          exit(); 
    66          return; 
     
    1717          return; 
    1818  } 
     19   
     20  include_once('common_elements.php'); 
    1921   
    2022  $categories = new categories($bm_db); 
     
    6870          if ($result) 
    6971          { 
     72            $smarty->clear_cache(null,'db|categories'); 
    7073            header("Location: admin_categories.php"); 
    7174            exit(); 
  • trunk/public_html/ajax_click.php

    r169 r210  
    22header("Content-Type: text/xml"); 
    33include_once('akarru.lib/common.php'); 
    4 print '<?xml version="1.0" encoding="ISO-8859-1" standalone="yes" ?>'; 
     4print '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>'; 
    55?> 
    66<root> 
  • trunk/public_html/ajax_vote.php

    r169 r210  
    22header("Content-Type: text/xml"); 
    33include_once('akarru.lib/common.php'); 
    4 print '<?xml version="1.0" encoding="ISO-8859-1" standalone="yes" ?>'; 
     4print '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>'; 
    55?> 
    66<root> 
     
    1212        if ($user_id == 1) { $bm_memes->promote($meme_id); } 
    1313        if ($user_id == 0) { 
    14                         $bm_memes->vote_anon($meme_id); 
     14                        $voted = $bm_memes->vote_anon($meme_id); 
     15            if (! $voted) 
     16            { 
     17                echo "<error>$be_already_voted</error>"; 
     18            } 
    1519        } 
    16         else if(!$bm_memes->check_votes_user($meme_id, $user_id)){ 
     20        else if(!$bm_memes->check_votes_user($meme_id,$user_id)){ 
    1721                $bm_memes->vote($meme_id,$user_id); 
    1822        }else{ 
  • trunk/public_html/akarru.lib/common.php

    r207 r210  
    9292  return (! in_array($ip, $noads)); 
    9393} 
     94 
     95// Error reporting functions 
     96function mail_error($error) { 
     97        // Change to your email address 
     98    mail('dummy@example.org', "Error on blogmemes", $error); 
     99} 
     100 
     101function logerror($error,$filename="errors",$send_email = 0) 
     102{ 
     103    $date = date('l dS \of F Y h:i:s A'); 
     104    $ip = "[" . $_SERVER["REMOTE_ADDR"] . "] - resolved=[" . gethostbyaddr($_SERVER["REMOTE_ADDR"]) . "]"; 
     105     
     106    $report = $error; 
     107    $report .= "\ndate=" . $date . "\nIP=" . $ip . " "; 
     108    $report = $report . "\nlooked for : " . $_SERVER["REQUEST_URI"]; 
     109    $report = $report . "\nfrom : " . $_SERVER["HTTP_REFERER"]; 
     110    $report = $report . "\nuser-agent : " . $_SERVER["HTTP_USER_AGENT"]; 
     111    $report = $report . "\nquery-string : " . $_SERVER["QUERY_STRING"]; 
     112    $report = $report . "\nhost : " . $_SERVER["HTTP_HOST"]; 
     113     
     114    $logfile = $_SERVER["DOCUMENT_ROOT"] . "/cache/logs/" . $filename; 
     115    $handleLog = fopen($logfile, "a"); 
     116    if ($handleLog) 
     117    { 
     118      fwrite($handleLog, $report . "\n"); 
     119      fclose($handleLog);   
     120    } 
     121     
     122    if ($send_email) 
     123    { 
     124        mail_error($report); 
     125    } 
     126} 
    94127} 
    95128 
  • trunk/public_html/cat_feed.php

    r170 r210  
    11<?php 
    22include_once('akarru.lib/common.php'); 
    3 $cat_id = $_GET['cat_id']; 
    4 if (empty($cat_id)) { 
    5         header('Location: feed.php'); 
     3$cat_id = intval($_GET['cat_id']); 
     4if ($cat_id == 0) { 
     5    logerror("cat_feed.php: cat_id = 0", "phpErrors"); 
     6        header('Location: /404.php'); 
    67        exit(); 
    78        return; 
     
    1112$bm_memes = new memes($bm_db, $bm_user); 
    1213$memes = $bm_memes->get_memes_by_category($cat_id, $page, '', $page == 0? 200 : 0); 
    13 print '<?xml version="1.0" encoding="utf-8" standalone="yes" ?>'; 
     14print '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>'; 
    1415?> 
    1516<rss version="2.0"> 
    1617<channel> 
    17 <title><?= $bm_site_name ?> - <?= $bm_memes->get_category_name($cat_id) ?></title> 
    18 <link><?= $bm_url ?></link> 
    19 <language><?= $bm_lang ?></language> 
    20 <description><?= $bm_desc ?></description> 
     18<title><? echo($bm_site_name); ?> - <? echo($bm_memes->get_category_name($cat_id)); ?></title> 
     19<link><? echo($bm_url); ?></link> 
     20<language><? echo($bm_lang); ?></language> 
     21<description><? echo($bm_desc); ?></description> 
    2122<copyright>(c) 2005 Eduardo Diaz Cortes</copyright> 
    2223<generator>akarru social bookmarking engine</generator> 
     
    3031foreach ($memes as $meme) 
    3132{ 
     33        $permalink = $bm_memes->get_permalink($meme->ID); 
    3234        echo '<item>'; 
    3335        echo '<title>'; echo htmlspecialchars($meme->title); echo '</title>'; 
    3436        echo '<description>'; echo htmlspecialchars($meme->content); echo '</description>'; 
    3537        echo '<pubDate>'; echo date("r", $meme->date_posted); echo '</pubDate>'; 
    36         echo '<link>http://www.blogmemes.com/comment.php?meme_id='.$meme->ID.'</link>'; 
     38        echo '<link>' . $permalink . '</link>'; 
     39    echo '<guid isPermaLink="true">' . $permalink . '</guid>'; 
    3740        echo '</item>'; 
    3841} 
  • trunk/public_html/circulation.php

    r62 r210  
    11<?php 
    2         $meme_id = $_GET['meme_id']; 
    3         if (empty($_GET['meme_id'])) { 
    4                         header("Location: index.php"); 
    5                         exit(); 
    6                         return; 
     2        $meme_id = intval($_GET['meme_id']); 
     3        if ($meme_id == 0) { 
     4        logerror("circulation.php: meme_id = 0", "phpErrors"); 
     5        header('Location: /404.php'); 
     6        exit(); 
     7                return; 
    78        } 
    89  include_once('akarru.lib/common.php'); 
    9   $smarty->assign('content_title', 'circulaci&oacute;n'); 
     10  include_once('common_elements.php'); 
     11  $smarty->assign('content_title', $content_title_circulation); 
    1012 
    1113 
     
    8688  $smarty->assign('clicks', $clicks); 
    8789  $smarty->assign('content', 'circulation'); 
     90  $smarty->assign('show_ads', showGGAds()); 
    8891  $smarty->display('master_page.tpl'); 
    8992?> 
  • trunk/public_html/comment.php

    r176 r210  
    11<?php 
     2 
     3  if (isset($_GET['voted'])) 
     4  { 
     5     $voted = (int) $_GET['voted']; 
     6  } 
     7   
    28  $meme_id = intval($_GET['meme_id']); 
    39  if ($meme_id == 0) { 
     
    511  } 
    612  if ($meme_id == 0) { 
    7           header("Location: index.php"); 
     13          header("Location: /404.php"); 
    814          exit(); 
    915          return; 
    1016  } 
    1117  include_once('akarru.lib/common.php'); 
    12   $smarty->assign('content_title', 'comentarios'); 
     18   
     19  include_once('common_elements.php'); 
     20   
     21  $smarty->assign('content_title', $content_title_comment); 
    1322  $memes = new memes($bm_db, $bm_user); 
    1423  if (!empty($_POST)) { 
     
    2332  } 
    2433  $memes->debate($meme_id, $bm_user, 0, true); 
    25   $meme = $memes->get_meme($meme_id, intval($_GET['share'])); 
     34  // Kenji : if referer is different than empty or blogmemes 
     35  // then there is a good chance that the user is coming 
     36  // from somewhere else => $share = 1 
     37  $share = 0; 
     38  if (strlen($_SERVER['HTTP_REFERER']) > 0) 
     39  { 
     40        $share = stristr($_SERVER['HTTP_REFERER'], $bm_url) ? 1 : 0; 
     41  } 
     42  $meme = $memes->get_meme($meme_id, $share); 
    2643  $comments = $memes->get_comments($meme_id); 
    27   $smarty->assign('page_title', 'blogmemes - '.$meme->title); 
     44  $smarty->assign('sub_title', $meme->title); 
     45 
    2846  $smarty->assign('meme', $meme); 
    2947  $smarty->assign('meme_id', $meme_id); 
     
    3755  foreach ($tags as $tag) 
    3856  { 
    39           $memes_tags[] = '&nbsp;<a href="/tag/'.$tag->tag.'">'.$tag->tag.'</a>&nbsp;&nbsp;'; 
     57          $memes_tags[] = '&nbsp;<a href="/memes_by_tag.php?tag_name='.$tag->tag.'">'.$tag->tag.'</a>&nbsp;&nbsp;'; 
    4058  } 
    4159  $smarty->assign('tags_of_meme', $memes_tags); 
     
    4967          $neutrals = $memes->get_neutrals($meme_id); 
    5068          $neutrals = array_diff($neutrals, $sponsors); 
    51           $neutrals[] = '<img border="0" src="/anon40.png" alt="anonimo" /><br /><a href="register.php">'.$meme->clicks.'&nbsp;'.$bl_anonymous.'</a>';  
     69          $neutrals[] = '<img border="0" src="/anon40.png" alt="' . $bl_anonymous . '"/><br /><a href="register.php">'.$meme->clicks.'&nbsp;'.$bl_anonymous.'</a>'; 
    5270          $smarty->assign('neutrals', $neutrals); 
    5371  } 
     
    5674          $smarty->assign('voters', $memes->get_voters($meme_id)); 
    5775  } 
     76  $smarty->assign('show_ads', showGGAds()); 
     77  if (isset($_GET['voted'])) 
     78  { 
     79    $smarty->assign('alreadyvoted', ($voted == 0)); 
     80    $smarty->assign('voted', $voted); 
     81  } 
     82  else 
     83  { 
     84    $smarty->assign('alreadyvoted', false); 
     85    $smarty->assign('voted', false); 
     86  } 
    5887  $smarty->display('master_page.tpl'); 
    5988?> 
  • trunk/public_html/community.php

    r175 r210  
    11<?php 
    22  include_once('akarru.lib/common.php'); 
    3   $smarty->assign('page_title', 'blogmemes - comunidad'); 
     3 
     4  include_once('common_elements.php'); 
     5   
     6    $page_size = 120; 
     7    $smarty->caching = 2; // lifetime is per cache 
     8    // community_grid 
     9    if (!$smarty->is_cached("community_grid.tpl", "db|users|community|" . $bm_page)) 
     10    { 
     11        $smarty->cache_lifetime = 3600*24; // Every 24 hours 
     12        $smarty->assign('community', $bm_users->get_profile_links(0, $bm_page,$page_size)); 
     13    } 
     14 
     15    $community_grid = $smarty->fetch('community_grid.tpl','db|users|community|' . $bm_page); 
     16    $smarty->caching = false; // turn off caching 
     17   
    418  $smarty->assign('content_title', $bl_community); 
    5   $page_size = 120; 
    619  $pages = ceil($bm_users->count_users()/$page_size); 
    720  $smarty->assign('pages', $pages+1); 
    8   $smarty->assign('community', $bm_users->get_profile_links(0, $bm_page,$page_size)); 
    9   $smarty->assign('content', 'community_grid'); 
     21  $smarty->assign('cached_content', TRUE); 
     22  $smarty->assign('content', $community_grid); 
    1023  $smarty->assign('content_feed_link', $bm_main_feeds); 
    11   $smarty->assign('show_ads', true); 
     24  $smarty->assign('show_ads', showGGAds()); 
    1225  $smarty->display('master_page.tpl'); 
    1326?> 
  • trunk/public_html/config.php

    r124 r210  
    1515$bm_queue_feeds = ''; 
    1616$bm_url_feeds = ''; 
     17$bm_url_queue_feeds = ''; 
    1718$bm_lang = 'es-es'; 
    1819$bm_url  = 'http://www.blogmemes.com/'; 
  • trunk/public_html/dynvotefeedflare.php

    r145 r210  
    6666     $url_format = $bm_url  . "comment.php?meme_id="; 
    6767     $startPos = strpos($_GET['url'], $url_format); 
    68      if ($startPos === false) 
     68     $rurl_format = $bm_url  . "meme/"; 
     69     $rstartPos = strpos($_GET['url'], $rurl_format); 
     70     if ($startPos === false && $rstartPos === false) 
    6971     { 
    7072     ?> 
     
    7880     } 
    7981      
    80      $startPos = $startPos + strlen($url_format); 
    81      $meme_id = substr($_GET['url'], $startPos); 
     82     if ($rstartPos === false) 
     83     { 
     84        $startPos = $startPos + strlen($url_format); 
     85        $meme_id = substr($_GET['url'], $startPos); 
     86     } 
     87     else 
     88     { 
     89        $rstartPos = $rstartPos + strlen($rurl_format); 
     90        $meme_id = substr($_GET['url'], $rstartPos); 
     91     } 
    8292    if (is_numeric($meme_id)) 
    8393    { 
  • trunk/public_html/edit_meme.php

    r188 r210  
    55  } 
    66  if ($meme_id == 0) { 
    7           header("Location: index.php"); 
     7          header("Location: /404.php"); 
    88          exit(); 
    99          return; 
    1010  } 
    1111  include_once('akarru.lib/common.php'); 
    12   $smarty->assign('content_title', 'editar'); 
     12  include_once('common_elements.php'); 
     13 
     14  $smarty->assign('content_title', $content_title_editar); 
    1315  $memes = new memes($bm_db, $bm_user); 
    14   $meme = $memes->get_meme($meme_id); 
     16  $meme = $memes->get_original_meme($meme_id); 
    1517  if ($meme->submitted_user_id != $bm_user && $bm_user != 1) { 
    1618          header("Location: comment.php?meme_id=$meme_id"); 
     
    2022  if (!empty($_POST))  
    2123  { 
     24      if ($bm_user == 1) 
     25      { 
     26        if ($_POST['disable'] == 1) 
     27        { 
     28            $memes->disable_meme($meme_id); 
     29        } 
     30        else 
     31        { 
     32            $memes->enable_meme($meme_id); 
     33        } 
     34      } 
     35       
    2236          $_POST['user_id'] = $bm_users->get_user_id(); 
    2337          $memes->update_meme($_POST); 
    24           header("Location: comment.php?meme_id=$meme_id"); 
     38 
     39          header("Location: /meme/$meme_id"); 
    2540          exit(); 
    2641          return; 
     
    3146  $smarty->assign('bm_cats', $bm_cats); 
    3247 
    33   $bm_options = array('0'=>'-- seleccione --'); 
     48  $bm_options = array('0'=>$content_title_post_seleccione); 
    3449  foreach ($bm_cats as $cat) 
    3550  { 
     
    3954 
    4055 
    41   $meme = $memes->get_meme($meme_id); 
     56  $meme = $memes->get_original_meme($meme_id); 
    4257  $comments = $memes->get_comments($meme_id); 
    4358  $smarty->assign('meme', $meme); 
     
    4762  foreach ($tags as $tag) 
    4863  { 
    49           $memes_tags .= $tag->tag . ','; 
     64          if (strlen($memes_tags) == 0) 
     65      { 
     66             $memes_tags .= $tag->tag; 
     67      } 
     68      else 
     69      { 
     70         $memes_tags .= ',' . $tag->tag; 
     71      } 
    5072  } 
    5173  $smarty->assign('meme_tags', $memes_tags); 
     
    5375  // end fix Kenji 
    5476  $smarty->assign('content', 'edit_post'); 
     77  $smarty->assign('show_ads', showGGAds()); 
    5578  $smarty->display('master_page.tpl'); 
    5679?> 
  • trunk/public_html/feed.php

    r182 r210  
    11<?php 
    2 header("Content-Type: text/xml"); 
     2header("Content-Type: application/rss+xml"); 
    33include_once('akarru.lib/common.php'); 
    44$bm_memes = new memes($bm_db, $bm_user); 
    55$memes = $bm_memes->get_memes(0, ' order by date_posted desc ', 1); 
    6 print '<?xml version="1.0" encoding="utf-8" standalone="yes" ?>'; 
     6print '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>'; 
    77?> 
    88<rss version="2.0"> 
    99<channel> 
    10 <title><?= $bm_site_name ?></title> 
    11 <link><?= $bm_url ?></link> 
    12 <description><?= $bm_desc ?></description> 
    13 <language><?= $bm_lang ?></language> 
     10<title><? echo($bm_site_name); ?>  <? echo($bl_last_memes); ?></title> 
     11<link><? echo($bm_url); ?></link> 
     12<description><? echo($bm_desc); ?></description> 
     13<language><? echo($bm_lang); ?></language> 
    1414<copyright>(c) 2005 Eduardo Diaz Cortes</copyright> 
    1515<generator>akarru social bookmarking engine</generator> 
     
    2323foreach ($memes as $meme) 
    2424{