Jump to content

Destramic

Members
  • Posts

    967
  • Joined

  • Last visited

Everything posted by Destramic

  1. hey guys im having a problem with my class it sees the constructor isnt loading and this line isnt executed spl_autoload_register(array($this, 'load_class')); i dont see why not if anyone can help please <?php class Autoloader { private static $_declared_classes = array(); private static $_ignore_files = array(); public function __construct() { spl_autoload_register(array($this, 'load_class')); } public static function load_class($class_name) { $class_name = ucwords($class_name); $file = self::get_class_path($class_name); try { if (!class_exists($class_name, FALSE)) { if (file_exists($file)) { require_once $file; self::$_declared_classes[] = $class_name; } else { throw new Exception(sprintf("Class '%s' not found.<br />\n", $class_name)); } } } catch (Exception $e) { echo $e->getMessage(); } } private static function get_class_path($class_name) { global $classes; if (array_key_exists($class_name, $classes)) { return ROOT . DS . $classes[$class_name]; } } public static function declared_classes() { echo "<pre>"; print_r(self::$_declared_classes); echo "</pre>"; } ?>
  2. ok but the file name could be the size of font_controller.class.php...that would work fine?
  3. hey guys im not that good when it comes to regex...im after the syntax were a string(filename) will have .class.php inside please if anyone can help. examples: test.class.php, help.class.php ...etc thank
  4. exactly what i wanted...thanks alot
  5. ok this is what i have at the moment. <?php if ($handle = opendir('../')) { while (false !== ($file = readdir($handle))) { echo $file . "<br />"; } closedir($handle); } ?> now in this loop it shows folders...but what i want to do is if the $file is a folder then open that up and read directory
  6. hey guys im tyring to read my directory (whole of the web server)...i want to be able to put the file name and root into an array...im just wanting to know whats the best function i need to do this please?...thank you
  7. hey guys im wanting to make a user availability script....but i just need your help on the best way on how to make this script please. bascially the users will be store in my mysql table but would it be best to select all users pass through json_encode($users_array) then check if user exsists through jquery json function?...if someone could tell me the best way to do this...or if you have an example that would be great thanks
  8. thanks for your help now ive learnt something too...plus my password strength function is complete now...thanks again
  9. thank you...although i could get it to work this way String.prototype.string_has_numbers = function(string) { var regex = /\d/g; return regex.test(string); } var password_value = "test1"; password_value.string_has_numbers()
  10. well i'd like another function which just checks if the string has uppper and lower case please
  11. i have a script that checks if a sting has numbers how can i check if the string has upper and lower case characters please? function string_has_numbers(string) { var regex = /\d/g; return regex.test(string); }
  12. Well i'll make a post tomorrow on your blog and maybe you could answer in fully there...maybe a example how rows can be implemented in a style other than a table (if possible)...would make a very useful and interesting article i'm sure
  13. thanks alot that worked a treat...also i read your atricle which is very inteteresting especially for someone like me as i dont know that much about css....but one last question whats the best way to view mysql database rows?...tables or is there a good method with div?...thanks again
  14. well it certianly didnt come accross that way...maybe we have misunderstood each other here. anyways i cant see how any other code would interupt my div from working but here is the page...excuse the mess im just trying to get script working before added into my framework <!DOCTYPE html> <html> <head> <script type="text/javascript" src="js/library/jquery.js"></script> <style type="text/css"> div { display : inline; } .invalid_text { color : #FF0000; font-size : 10px; font-family : Verdana, Arial, Helvetica, sans-serif; } .valid_text { color : #228b22; font-size : 10px; font-family : Verdana, Arial, Helvetica, sans-serif; } .password_minimum_characters { font-size : 9px; font-family : Verdana, Arial, Helvetica, sans-serif; } .password_too_short_text { color : #FF0000; font-size : 10px; font-family : Verdana, Arial, Helvetica, sans-serif; } </style> </head> <body> <script> $(document).ready(function() { function match_validation(selector, selector2, field_label) { selector = $('#' + selector); selector2 = $('#' + selector2); $(selector).change(function() { var field_value = $(selector).val().toLowerCase(); var field2_value = $(selector2).val().toLowerCase(); if (field_value.length == 0 || field2_value.length == 0) { $('div#match_validation_message').text(''); } else if (field2_value.length !== 0) { if (field_value !== field2_value) { $('div#match_validation_message').text(field_label + " doesn't match"); $('div#match_validation_message').removeClass("valid_text").addClass("invalid_text"); } else { $('div#match_validation_message').text(field_label + " matches"); $('div#match_validation_message').removeClass("valid_text").addClass("valid_text"); } } }); $(selector2).change(function() { var field_value = $(selector).val().toLowerCase(); var field2_value = $(selector2).val().toLowerCase(); if (field_value.length == 0 || field2_value.length == 0) { $('div#match_validation_message').text(''); } else if (field_value.length !== 0) { if (field_value !== field2_value) { $('div#match_validation_message').text(field_label + " doesn't match"); $('div#match_validation_message').removeClass("valid_text").addClass("invalid_text"); } else { $('div#match_validation_message').text(field_label + " matches"); $('div#match_validation_message').removeClass("valid_text").addClass("valid_text"); } } }); $(selector).change(); } function password_strength(password, minimum_character_size) { password = $('#' + password); $(password).after('<br /><div id="password_minimum_characters" class="password_minimum_characters">Minimum number of characters is ' + minimum_character_size + '</div>'); $(password).change(function() { var password_length = password.val().length; if (password_length < minimum_character_size) { $(password).after('Too Short'); } // very weak > mimimum characters // weak 3 // medium 6 // strong numbers // very strong contains higher case }); } match_validation('email', 'confirm_email', 'E-mail Address'); password_strength('password', ; }); </script> <form method="post"> <label for="username">Username :</label> <input id="username" name="username" value="" type="text" /><br /> <label for="email">E-mail Adresss :</label> <input id="email" name="email" value="" type="text" /><div id="match_validation_message"></div><br /> <label for="confirm_email">Confirm E-mail Address :</label> <input id="confirm_email" name="confirm_email" value="" type="text" /><br /> <label for="password">Password :</label> <input id="password" name="password" value="" type="text" /><br /> <div style="background-color:#ff9900; border: 1px solid white; height: 25px; width: 200px;"></div> <input type="submit" value="Submit"> </form> </body> </html>
  15. @cssfreakie i understand i need to buy a book...but ive only written on this forum for help...and if you dont want to offer any help then dont reply back to my posts...simple now ive tried this on firefox and ie and div doesnt appear...but if i put text in between the tags then it shows...but for this div i dont want any text in it...i just want the bar <div style="background-color:#ff9900; border: 1px solid white; height: 25px; width: 200px;"></div> thanks
  16. the css is normally in a style sheet its just in the div for a example of the code...but the div code abve doesnt display anything...alll i want it to do is just display a small like about 5 px tall 150 px wide
  17. hey guys...i want to create a bar for my password strength script...but the code below wont shw anything if anyone can help <div class="bar" id='bar' style="background-color:#ff9900; border: 1px solid white; font-size: 1px; height: 5px; width: 120px;"></div> also do you just use <span> tags for text? thanks
  18. i got that working great with that code thanks alot CSSFREAKIE
  19. hes is the image...you'll see the text add game type and remove game type and the images...thank a lot [attachment deleted by admin]
  20. hey guys i have an image and some text inside a div but i want to be able to align the text vertically do it is in the middle of the image...if someone could help that would be great <div id="add_game_types"><img src="add2.gif" data-hover="add.gif" /> Add Game Type</div> css: div#add_game_types, #remove_game_types { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; vertical-align: text-top; cursor:pointer; } thank you
  21. i found out that hide() / fadein() is the result to the added style $(input_field).appendTo('div#' + selector).hide().fadeIn(1200);
  22. i hope this helps you to understand my problem: but you'll need jquery plugin : http://jquery.com/ and cookies : http://plugins.jquery.com/project/Cookie <!DOCTYPE html> <html> <head> <script type="text/javascript" src="js/library/jquery.js"></script> <script type="text/javascript" src="js/library/jquery.cookie.js"></script> </head> <body> <script> $(document).ready(function() { function add_input(selector, fields, field_type, break_point) { var count = 1; var loop_count = 1; var fields_count = $.param(fields).split('&').length; var breakage_point; var field_name; $('div#add_' + selector).click(function() { $.each(fields, function(field_name, field_label) { breakage_point = fields_count * count; field_name = field_name + count; input_field = '<label for="' + field_name + '">' + field_label + ' ' + count + ' : </label><input id="'+ field_name +'" name="' + field_name + '" type="' + field_type + '" value="" />'; if (loop_count == breakage_point) { input_field += '<br />'; } $(input_field).appendTo('div#' + selector).hide().fadeIn(1200); loop_count++; }); count++; $.cookie(selector + '_count', count); if (count > 1) { $('div#remove_' + selector).hide().fadeIn(1200); } }); $('div#remove_' + selector).click(function() { var remove_field = ''; $.each(fields, function(field_name, field_label) { field_name = field_name + (count - 1); field_label = field_label + ' ' + (count - 1); var field_value = $('#' + field_name).val(); remove_field += $('<label for="' + field_name + '">' + field_label + ' : </label><input id="' + field_name + '" name="' + field_name + '" value="' + field_value + '" type="text">'); alert($('div#' + selector).html()); }); if (loop_count == breakage_point) { remove_field += '<br>'; } var replace = $('div#' + selector).html().replace(remove_field, ''); $('div#' + selector).html(replace); count--; $.cookie(selector + '_count', count); if (count < 3) { $('div#remove_' + selector).fadeOut(1200); } }); if ($.cookie(selector + '_count')) { var cookie_count = $.cookie(selector + '_count'); for (i=1; i < cookie_count; i++) { $('div#add_' + selector).click(); } } if (count < 3) { $('div#remove_' + selector).hide(); } } var fields = {'game_types' : 'Game Type - Name', 'game_types_abbreviated' : 'Game Type - Abbreviated'}; add_input('game_types', fields, 'text', 2); }); </script> <form method="post"> <label for="game_name">Game Name:</label> <input id="game_name" name="game_name" value="" type="text" /><br /><a></a> <label for="game_name_abbreviated">Game Name Abbreviated:</label> <input id="game_name_abbreviated" name="game_name_abbreviated" value="" type="text" /><br /> <div id="game_types"></div><br /> <div id="add_game_types">Add Game Type</div> <div id="remove_game_types">Remove Game Type</div> <input type="submit" value="Submit"> </form> </body> </html>
  23. It's the first time i've come across it with javascript as i've never noticed this effect with any of my other scripts...are you sure this is normal to have a style automatically added to a tag?...and i'm currently using firefox web browser
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.