LCKB
3.6.1/2 Optional Fixes - Printable Version

+- LCKB (https://lckb.dev/forum)
+-- Forum: ** OLD LCKB DATABASE ** (https://lckb.dev/forum/forumdisplay.php?fid=109)
+--- Forum: Website Scripting & Security (https://lckb.dev/forum/forumdisplay.php?fid=197)
+---- Forum: LastChaos - CMS (https://lckb.dev/forum/forumdisplay.php?fid=182)
+----- Forum: ToXiC Support (https://lckb.dev/forum/forumdisplay.php?fid=206)
+----- Thread: 3.6.1/2 Optional Fixes (/showthread.php?tid=3330)



- Sutz - 01-21-2014


Fix the lottery "Total Tickets" 3.6.1 will just count all total tickets but you can change the query to only count that weeks sales.

Edit core.php and search for:
$query4 = sprintf("SELECT count(:index) FROM %s.t_lottery", $LC_LCDb );
 
Change to:
 
$query4 = sprintf("SELECT count(:index) FROM %s.t_lottery WHERE a_week_num = (SELECT max(a_week_num) FROM %s.t_lottery)", $LC_LCDb, $LC_LCDb );

Fix the top voters block ranks, this is bugged and wont list the highest voters right.

Open navi cat an edit the table t_votes_history change a_complete from varchar to int

----

!!THIS IS A FIX LIST ONLY NOT CHAT!!

ONLY REPLY WITH YOUR FIXES YOU DONE!

IF YOU WANT TO SAY THANKS HIT THE LIKE

 

Thankyou Smile




- Sutz - 01-27-2014


FIX View Profile (Black page) when behind CloudFlare

Open profile.php & forgot_pass.php
Search an replace $_SERVER[REMOTE_ADDR] with $IPLim

Open pingback.php
 
After include "styles/style.php"; add
 
function get_real_ip_noimport(){
if (isset($_SERVER["HTTP_CLIENT_IP"])) return $_SERVER["HTTP_CLIENT_IP"];
elseif (isset($_SERVER["HTTP_X_FORWARDED_FOR"])) return $_SERVER["HTTP_X_FORWARDED_FOR"];
elseif (isset($_SERVER["HTTP_X_FORWARDED"])) return $_SERVER["HTTP_X_FORWARDED"];
elseif (isset($_SERVER["HTTP_FORWARDED_FOR"])) return $_SERVER["HTTP_FORWARDED_FOR"];
elseif (isset($_SERVER["HTTP_FORWARDED"])) return $_SERVER["HTTP_FORWARDED"];
else return $_SERVER["REMOTE_ADDR"];
}
$IPLim = get_real_ip_noimport();
 
Then search an replace $_SERVER[REMOTE_ADDR] with $IPLim
 




- LikeToMove - 01-27-2014


For all who need to test more CloudFlare and dont want to edit code all the time into website, just follow this steps:

 

open config.php and add this string:

$Allow_CloudFlare = yes; // Choose yes or no

then open functions.php and edit this:

function get_real_ip_noimport(){
if (isset($_SERVER["HTTP_CLIENT_IP"])) return $_SERVER["HTTP_CLIENT_IP"];
elseif (isset($_SERVER["HTTP_X_FORWARDED_FOR"])) return $_SERVER["HTTP_X_FORWARDED_FOR"];
elseif (isset($_SERVER["HTTP_X_FORWARDED"])) return $_SERVER["HTTP_X_FORWARDED"];
elseif (isset($_SERVER["HTTP_FORWARDED_FOR"])) return $_SERVER["HTTP_FORWARDED_FOR"];
elseif (isset($_SERVER["HTTP_FORWARDED"])) return $_SERVER["HTTP_FORWARDED"];
else return $_SERVER["REMOTE_ADDR"];
}

to this:

function get_real_ip_noimport(){
if (isset($_SERVER["HTTP_CLIENT_IP"])) return $_SERVER["HTTP_CLIENT_IP"];
elseif (isset($_SERVER["HTTP_X_FORWARDED_FOR"])) return $_SERVER["HTTP_X_FORWARDED_FOR"];
elseif (isset($_SERVER["HTTP_X_FORWARDED"])) return $_SERVER["HTTP_X_FORWARDED"];
elseif (isset($_SERVER["HTTP_FORWARDED_FOR"])) return $_SERVER["HTTP_FORWARDED_FOR"];
elseif (isset($_SERVER["HTTP_FORWARDED"])) return $_SERVER["HTTP_FORWARDED"];
else return $_SERVER["REMOTE_ADDR"];
}
$IPLim = get_real_ip_noimport();

open forgot_pass.php at line 20, then replace

$IP = $_SERVER[REMOTE_ADDR];

with

if( $Allow_CloudFlare == yes ){
$IP = $IPLim;
} else {
$IP = $_SERVER[REMOTE_ADDR]; }

so open profile.php and add this code on line 48

if( $Allow_CloudFlare == yes ){
$IPcloud = $IPLim;
} else {
$IPcloud = $_SERVER[REMOTE_ADDR]; }

and replace

if( isset($Post->Nickname) && $success == true && $CMS_IPlog == $_SERVER[REMOTE_ADDR]; )

with

if( isset($Post->Nickname) && $success == true && $CMS_IPlog == $IPcloud )

Well, now you can set easily if you want to use CloudFlare in your config.php by typing a simple yes or no Wink