-
Posts
2,491 -
Joined
-
Last visited
-
Days Won
196
Content Type
Profiles
Forums
Events
Everything posted by Dayo
-
I'll look into the font idea, I had that originally but didn't like it too much but that could have been the font. I'll also look at the responsiveness, are you using something like an iPhone 4? I tried on my 6 and it worked fine but it does have a larger screen. I did only spend 20 minutes on making it responsive so I have a lot of cleaning/fixing to do with the CSS but thanks for the heads up
-
I need a banner/logo made to fit in with a game myself and a mate is developing. I need something for the top right/center of https://thebattlefield.co.uk/beta
-
This would be very easy with Node.js + socket.io but if you are using a shared hosting with no CLI/node integration you can use PHP with JQuerys ajax call (this is a very inefficient way to do this but is the easiest)
-
look for a open ( or { in the lines before, also next time please paste the code rather then an image
-
I use Arch Linux as the OS on both my PC and servers they all run with nginx, php-fpm/node.js and mysql for the web server/database. As for crons i use vixe-cron but i have used cronie before
-
have you got a portfolio/website?
-
- 1
-
-
this was 7+ ytears ago so if i did i have no knoladge of it now What is it that you need? i.e. Do you want to replace the McCodes Login/Registration with PHPBB? Or the other way around? Or do you want it so if a user registers for the game a user account is already made on the forum and when they log in it logs them into the forum as well?
-
this is a blast from the past think i must of been 16/17 then :P
-
maybe it will be released after half life 3 :P
-
here is an example select * from test order by ID asc LIMIT 0, 10; -- gets rows 0-10 select * from test order by ID asc LIMIT 10, 10; -- gets rows 11-20 select * from test order by ID asc LIMIT 20, 10; -- gets rows 21-30 select * from test order by ID asc LIMIT 30, 10; -- gets rows 31-40 $page = (int) $_GET["page"]; $sql = "select * from test order by ID asc LIMIT ".($page * 10).", 10";
-
if there is no gang you are echoing out that the user is in no gang but not killing the script, after that you are missing $h->endpage(); or you coulde use else { /* $gangdata ...*/ }
-
have you got this on a live site where i can see whats going on. I have made the code a little more readable, i have not tested this so tehre could still be errors <?php if(!isset($set)) { $set=array(); $settq=$db->query("SELECT * FROM settings"); while($r=$db->fetch_row($settq)) { $set[$r['conf_name']]=$r['conf_value']; } } echo ' <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function() { $(".chat_bar").click(function() { var this_ele = $(this); if($(this).parents(".chat_box").hasClass("hidden")) { $(this).parents(".hidden").animate({bottom: "0px"},500,function() { $("[name=" + this_ele.parents(".chat_box").attr("id") + "]").focus();updateShoutbox(); }).addClass("open").removeClass("hidden"); c_name = "chat_" + $(this).parents(".chat_box").attr("id"); document.cookie=c_name + "=open"; } else { $(this).parents(".open").animate({bottom: "-320px"},500,function() { updateShoutbox(); }).addClass("hidden").removeClass("open"); c_name = "chat_" + $(this).parents(".chat_box").attr("id"); document.cookie=c_name + "=hidden"; } }); $(".chat_contents").click(function() { $("[name=" + $(this).parents(".chat_box").attr("id") + "]").focus(); }); $(".chat_form").each(function() { $(this).submit(function() { alert("test"); }); }); updateShoutbox(); }); function scrollBottom() { $(".chat_box").each(function() { $(this).children(".chat_contents").scrollTop($(this).children(".chat_contents")[0].scrollHeight); }); } function updateShoutbox() { $(".open").each(function() { var chat_box = $(this).children(".chat_contents"); $.ajax({ type: "POST", url: "ajax_chat/chat_ajax.php", cache: false, data: "function=chat_box" + (chat_box.parents(".open").hasClass("gang") ? "&gang=" + chat_box.parents(".open").attr("id") : "&channel=" + $(this).attr("id")), success: function(data) { chat_box.html(data); scrollBottom(); } }); }); } function sendChat(channel_id) { var chat_field = $("[name=" + channel_id + "]"); if(chat_field.val() != "" && chat_field.val() != " ") { chat_field.attr("disabled",true); $.ajax({ type: "POST", url: "ajax_chat/chat_ajax.php", cache: false, data: "function=send_chat" + (chat_field.parents(".open").hasClass("gang") ? "&gang=" + chat_field.parents(".open").attr("id") : "&channel=" + channel_id) + "&msg= " + chat_field.val(), success: function(data) { if(data == 1) { updateShoutbox(); chat_field.val(""); chat_field.attr("disabled",false); } else { alert("You\'re trying to post in a channel that either dosen\'t exist or your account does not have access to."); chat_field.attr("disabled",false); } } }); } } setInterval("updateShoutbox()",'.$set['refresh_time'].'); </script> <style type="text/css"> .chat_box { background: #'.$set['main_back'].'; color: #'.$set['chat_text'].'; position: fixed; right: 20px; bottom: 0px; width: 240px; height: 350px; '.($set['opacity'] == 1 ? 'opacity: '.$set['opacity_level'].'' : ''); if($set['round_corners'] == 1) { echo '-webkit-border-top-left-radius: '.$set['round_corners_amount'].'px; -webkit-border-top-right-radius: '.$set['round_corners_amount'].'px; -moz-border-radius-topleft: '.$set['round_corners_amount'].'px; -moz-border-radius-topright: '.$set['round_corners_amount'].'px; border-top-left-radius: '.$set['round_corners_amount'].'px; border-top-right-radius: '.$set['round_corners_amount'].'px'; } if($set['box_shadow'] == 1) { echo '-moz-box-shadow: 0px 0px 10px #888; -webkit-box-shadow: 0px 0px 10px #888; box-shadow: 0px 0px 10px #888'; } echo '} .chat_box:hover { opacity: 1; } .chat_box .chat_bar { position: absolute; top: 0px; left: 0px; right: 0px; padding: 9px; background: #'.$set['top_bar'].'; color: #'.$set['top_bar_text'].'; text-align: left'; if($set['round_corners'] == 1) { echo '-webkit-border-top-left-radius: '.$set['round_corners_amount'].'px; -webkit-border-top-right-radius: '.$set['round_corners_amount'].'px; -moz-border-radius-topleft: '.$set['round_corners_amount'].'px; -moz-border-radius-topright: '.$set['round_corners_amount'].'px; border-top-left-radius: '.$set['round_corners_amount'].'px; border-top-right-radius: '.$set['round_corners_amount'].'px'; } echo '} .chat_box .chat_bar:hover { background: #'.$set['top_bar_hover'];.'; color: #'.$set['top_bar_text_hover'];.'; cursor: pointer; } .chat_box .chat_contents { position: absolute; overflow-y: scroll; left: 6px; right: 6px; top: 40px; text-align: left; height: 270px; } .chat_box .chat_contents #line { display: block; padding: 3px; } .chat_box .chat_contents span #time { font-size: 8px; } .chat_box #chat_input { position: absolute; bottom: 0; left: 0; right: 0; padding: 3px; } .chat_box #chat_input input { width: 95%; border: none; padding: 5px; background: #'.$set['input_box'].'; color: #'.$set['input_box_text'].'; } .hidden { bottom: -320px; } </style> <!--[if IE]> <style type="text/css"> .chat_box #chat_input { margin-bottom: -20px; } </style> <![endif]--> <!--[if lt IE 7]> <style type="text/css"> .chat_box { display: none; } </style> <![endif]-->'; // Make any changes to the system that is needed for the system to work. $fields = array('top_bar','top_bar_hover','top_bar_text','top_bar_text_hover','chat_text','main_back','input_box','input_box_text','opacity','opacity_level','round_corners','round_corners_amount','box_shadow','channel_number','refresh_time','filter_words','new_words'); $values = array('bdbdbd','afafaf','000000','000000','000000','e2e2e2','bdbdbd','000000',1,0.8,1,5,1,1,2000,'****,cunt,****','****,****,****'); $count = 0; foreach($fields as $f) { if(!isset($set[$f])) { $db->query("INSERT INTO settings (conf_name,conf_value) VALUES('".$f."','".$values[$count]."')"); ++$changed; } ++$count; } $table[] = "CREATE TABLE IF NOT EXISTS `chat_box` ( `chat_id` int(11) NOT NULL AUTO_INCREMENT, `chat_user` int(11) NOT NULL, `chat_to` int(11) NOT NULL, `chat_text` varchar(255) NOT NULL, `chat_time` int(11) NOT NULL, `chat_channel` int(11) NOT NULL, `chat_gang` int(11) NOT NULL, PRIMARY KEY (`chat_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=0 ;"; $table[] = "CREATE TABLE IF NOT EXISTS `chat_channels` ( `channel_id` int(11) NOT NULL AUTO_INCREMENT, `channel_alias` varchar(255) NOT NULL, `channel_name` varchar(255) NOT NULL, `channel_open` int(1) NOT NULL, `channel_req` text NOT NULL, PRIMARY KEY (`channel_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=0 ;"; foreach($table as $t) { $db->query($t) or die('<b>MySQL Databse insertion error:</b><p>An error has occured when the system attempted to dump the various database information into the table. Please check the error below.<br />'.mysql_error()); } if(isset($changed)) { header("Location: ".$_SERVER['PHP_SELF']); exit; } // Make any changes to the system that is needed for the system to work. $find_channels = $db->query("SELECT channel_name, channel_id, channel_alias, channel_open, channel_req FROM chat_channels"); if($db->num_rows($find_channels)) { $chat_count = 1; while($chan = $db->fetch_row($find_channels)) { $failed = 0; if($chan['channel_req']) { $privs = unserialize($chan['channel_req']); foreach($privs as $p) { $check_priv = $db->query("SELECT userid FROM users WHERE `".mysql_real_escape_string($p[0])."` ".mysql_real_escape_string($p[1])." '".mysql_real_escape_string($p[2])."' AND userid = ".$userid); if(!$db->num_rows($check_priv)) { $failed = 1; } } } if($failed < 1) { $hiddenChatBox = ( (isset($_COOKIE['chat_'.$chan['channel_alias']]) && $_COOKIE['chat_'.$chan['channel_alias']] == 'hidden') ? ' hidden' : ( (!isset($_COOKIE['chat_'.$chan['channel_alias']]) && $chan['channel_open'] == 1) ? ' hidden' : ' open' ) ); echo '<div id="'.$chan['channel_alias'].'" class="chat_box '.$hiddenChatBox.'" '.($chat_count > 1 ? 'style="right: '.((($chat_count-1)*262)+20).'px;"' : '').' <div class="chat_bar"> '.($set['channel_number'] == 1 ? $chan['channel_id'].'.' : '').' '.$chan['channel_name'].' </div> <div class="chat_contents"> </div> <div id="chat_input"> <form action="#" onsubmit="sendChat(\''.$chan['channel_alias'].'\');return false;"> <input type="text" name="'.$chan['channel_alias'].'" class="chat_msg" /> </form> </div> </div>'; ++$chat_count; } } } if(isset($ir['gang'])) { $gang_data = $db->query("SELECT gangNAME FROM gangs WHERE gangID = ".$ir['gang']); if($db->num_rows($gang_data)) { $g_data = $db->fetch_row($gang_data); echo ' <div id="'.$ir['gang'].'" class="chat_box gang '.(isset($_COOKIE['chat_'.$ir['gang']]) && $_COOKIE['chat_'.$ir['gang']] == 'hidden' ? ' hidden' : (!isset($_COOKIE['chat_'.$ir['gang']]) && $chan['channel_open'] == 1 ? ' hidden' : ' open')).'" '.($chat_count > 1 ? 'style="right: '.((($chat_count-1)*262)+20).'px;"' : '').' <div class="chat_bar"> '.$g_data['gangNAME'].' Chat </div> <div class="chat_contents"> </div> <div id="chat_input"> <form action="#" onsubmit="sendChat(\''.$chan['channel_alias'].'\');return false;"> <input type="text" name="'.$chan['channel_alias'].'" class="chat_msg" /> </form> </div> </div> '; } } ?>
-
anyone got a v2 licence they want to sell, PM me.
-
this was the output of the query i provided Output mysql> select * from test limit 10; +----+--------+ | id | random | +----+--------+ | 1 | 463 | | 2 | 529 | | 3 | 255 | | 4 | 489 | | 5 | 679 | | 6 | 930 | | 7 | 712 | | 8 | 673 | | 9 | 229 | | 10 | 825 | +----+--------+ 10 rows in set (0.00 sec) mysql> update test SET `random` = FLOOR(RAND() * 900) + 100; -- Random number between 100 and 1000 Query OK, 126664 rows affected (0.40 sec) Rows matched: 126818 Changed: 126664 Warnings: 0 mysql> select * from test limit 10; +----+--------+ | id | random | +----+--------+ | 1 | 438 | | 2 | 802 | | 3 | 796 | | 4 | 575 | | 5 | 388 | | 6 | 116 | | 7 | 216 | | 8 | 634 | | 9 | 620 | | 10 | 198 | +----+--------+ 10 rows in set (0.00 sec) mysql> It looks like you are trying to use PHP in a SQL query as rand(100, 900) is PHP syntax, the MySQL RAND() function has no parameters and only returns a random float from 0 to 1, you have to parse it like i did
-
you can do this with SQL (see the example below) mysql> update test SET `random` = FLOOR(RAND() * 900) + 100; -- Random number between 100 and 1000 I created a simple table to test this with with 100k rows to see how efficient the RAND function is (sill be more efficient then running 100k+ queries) Query OK, 126818 rows affected (2.27 sec) Rows matched: 126818 Changed: 126818 Warnings: 0 change the 100 to the the minimum value of what you want then change 900 to the maximum value you want minus the minimum value (if that makes sense).
-
Its been a while since i posted here (i still check the forums occasionally) was just wondering what people are up-to now a days (doesn't have to be coding/gaming related)
-
This is similar to the one above but checks if the background exists, if not will load the default background image, you may have to change the CSS class to match your HTML/CSS <?php $file = "/path/to/images" . pathinfo(__FILE__, PATHINFO_FILENAME) . ".png"; if (!file_exists($file)) $file = "/path/to/default/background.png"; echo "<style> .header { background-image: url('$file'); background-size: cover; } </style>"; ?>
-
you cant do overflow-y: scroll within a table as this can only be used with a block element there are jquery plugins like http://www.farinspace.com/jquery-scrollable-table-plugin/ that will split the headers/body/footer up into seperate elements and wrap the tbody into a div that scrolls
-
Also hosting the source code on github would make it easier to review, plus alot easier for you to manage
-
is there a demo? I just downloaded and checked application\controller\home.php, there is alot of repeated code i.e. require APP . 'view/_templates/external/header.php'; require APP . 'view/home/index.php'; require APP . 'view/_templates/external/footer.php'; that was repeated 9 times, this can make updating/maintaining it very hard
-
Request for Business mod for Version two
Dayo replied to Mcfarlin's topic in Requests & In Production
What do you want the user to do? Can you start different types of business that do different tasks also you could expand on this by requiring certain courses to apply for the job -
when i try to link my account i get "App Not Setup: This app is still in development mode, and you don't have access to it. Switch to a registered test user or ask an app admin for permissions." That is from facebook not the forum software
- 1 reply
-
- 1
-
-
Any idea when this will work?
-
A mate at work recently showed me this site https://letsencrypt.org/howitworks/ its a site that provides free SSL certificates and they were very easy to set up (with nginx cant say for other web servers). I know it only saves like £4 but any saving is good in my eyes.
-
- 2
-