fantomel
Members-
Posts
186 -
Joined
-
Last visited
Everything posted by fantomel
-
hmm i understand i wasn't sure if it's correct what i've heard that some stuff from html 5 are implemented in new versions of safara ff opera.. since i`ve started to build a form class i wanted to build it directly for html 5 when it will be full implemented i won`t have trouble in using it corectly . and what you have heard about old tags could cause a problem for all websites :-? i think.
-
i have started to build the code from scratch and i have encountered another problem $(document).ready(function(){ $('.work li a img').mouseover(function(){ $('.work li a img').append('.features'); $('.features').css('display', 'block'); }); $('.work li a img').mouseout(function(){ $(".features").css('display', 'none'); }); }) when i`m going with the mouseover it goes on and on doesn't stop and showing only the second div.
-
hello ppl i`m in a hurry and i need some fast help with a problem. /* $(' div#main a ').hide(); // for hiding links by default $(' div#main ').hover(function() { $(this).child("a").show(); // shows links on mouseIn }, function() { $(this).child("a").hide(); // hides links on mouseOut }); */ /*$(document).ready(function(){ $("li a, .features").hover(function() { $(".features").show().stop(); }, function() { $(".features").hide().stop(); }); }); */ $(document).ready(function(){ $("a").mouseover(function(){ $(this).next(".features").show(); }).mouseout(function(){ $(this).child(".features").hide(); }); }); when i`m going over with the mouse it shows what it needs but when i`m out it remains doesn`t show the thumbail.
-
Routing system if someone can explain to me please
fantomel replied to fantomel's topic in Application Design
yeah.. maybe.. i found a file regarding this config class Url { private $urlfragments, $mod; public $url, $file; public function __construct( ) { $cfg = Config::getConfig('url'); $this->mod = (($cfg['rewrite']) == false) ? 1 : 0; $this->url = $cfg['url'] . ( $cfg['rewrite'] ? '' : 'index.php/' ); $nUrl = array(); if( array_key_exists('PATH_INFO', $_SERVER) ) { $nUrl = explode('/',$_SERVER['PATH_INFO']); $nUrl = array_splice( $nUrl, 1); } $this->urlfragments = $nUrl; if( defined("IN_ADMIN") && IN_ADMIN == true ) { $this->file = 'admin.php'; }else{ $this->file = 'index.php'; } } public function seg( $num , $returnValue = '' ) { return ( isset( $this->urlfragments[ $num + $this->mod ]) && $this->urlfragments[$num + $this->mod] != '') ? $this->urlfragments[ $num + $this->mod ] : $returnValue; } public function seg_array( $start, $end, $returnValue = '' ) { $array_splice = array_splice( $this->urlfragments, $start + $this->mod, ($end - $start) + $this->mod); return (count($array_splice) > 0 ) ? $array_splice : $returnValue; } public function seg_all() { return $this->urlfragments; } public function seg_fetch_assoc() { $tick = 0; $return = array(); for( $i = 0 + $this->mod; $i <= count($this->urlfragments); ++$i ) { if( isset($this->urlfragments[$i]) && isset($this->urlfragments[$i + 1])) { $return[ $this->urlfragments[$i] ] = $this->urlfragments[ ++$i ]; }elseif( isset($this->urlfragments[$i]) ) { $return[ $this->urlfragments[$i] ] = ''; } } return $return; } public function seg_assoc( $array = array() ) { $return = ''; foreach( $array as $key => $val ) { $return .= $key . '/' . $val . '/'; } return $return; } public function seg_return_string( $url = null ) { $url = ( is_null($url) ) ? $this->urlfragments : $url; return implode( '/', $url ); } public function sanitize( $string ) { return str_replace('/', '*', $string); } public function revert( $string ) { return str_replace('*', '/', $string); } } class Route { public static $route, $processed, $isRegex, $isPlain; private static function __init() { //Is route already set? if( !is_array(self::$route) ) { //It's not so retreieve the variables from the config file $routing = Config::getConfig('routing'); //Is the config file empty? if( is_array($routing) ) { //Are there any rules set? $routeCount = count($routing['url']); //There may be, so set it if( $routeCount > 0 ) { self::$route = $routing; } } } self::__processRouteVariables(); } private static function __processRouteVariables() { self::$isPlain = array(); self::$isRegex = array(); //Make sure the variables either havent' been previously //processed or the route variable is actually filled if( !is_array(self::$route) || self::$processed ) { return; } //populate variables $rules = self::$route['rules']; $routes = self::$route['url']; //serperate out our rules $ruleKeys = array_keys( $rules ); $ruleValues = array_values( $rules ); //Make a variable to hold our new rules $newRoutes = array(); //Cyecle through all of them foreach( $routes as $routeKey => $routeValue ) { //Take a count of of the black slaces $tmpKeyCount = count(explode('/', $routeKey)); $tmpValCount = count(explode('/', $routeValue)); //Keep the route values $tmpKey = $routeKey; $tmpVal = $routeValue; //now make them regex safe $routeKey = preg_quote($routeKey); $routeValue = preg_quote($routeValue); //count the black slashes now $pstKeyCount = count(explode('\\', $routeKey)); $pstValCount = count(explode('\\', $routeValue)); //echo $tmpKey, '<br />', $tmpKeyCount, '<br />', $pstKeyCount, '<br /><br />'; //the logic here is quite simple, if the back slashes are more than double what //there used to be it means more than the foward slashes and other regex on-safe //characters have been quotes meaning this string is a regex string so don't touch //it if( $pstKeyCount == 1 && !strstr(':', $tmpKey) ) { self::$isPlain[ $tmpKey ] = true; $routeKey = $tmpKey; $routeValue = $tmpVal; }elseif( (($tmpKeyCount * 2) < $pstKeyCount) || (($tmpValCount * 2) < $pstValCount) ) { //put it in the is regex array and refill our values with their original //values //echo $tmpKey; self::$isRegex[ $tmpKey ] = true; $routeKey = $tmpKey; $routeValue = $tmpVal; }else{ //This string is a to-be parsed wild card string so parse it //and construct our regex string $routeKey = str_replace( $ruleKeys, $ruleValues, $routeKey ); $routeValue = str_replace( $ruleKeys, $ruleValues, $routeValue ); //Let's go after results if( strstr( $routeValue, ':result') ) { //since the parsed wild-card string has already been made //regex safe, we need the temporary string tht hasn't been //modified $results = explode(':result', $tmpVal); $resultCount = count($results) - 1; $resultString = null; //Cycle through our array and create the result string regex for($i = 0; $i < $resultCount; ++$i) { $resultString .= $results[$i] . '$' . ($i + 1); } $routeValue = $resultString; } } //Fill our new array of rules $newRoutes[ $routeKey ] = $routeValue; } self::$route = $newRoutes; //print_r(self::$route); } public static function setRoute( Array $route ) { //set the route if the url rule isn't empty if( count($route['url']) > 0 ) { self::$route = $route; } } public static function DoRoute($controller, $mod) { self::__init(); //after we've ran out initiate function is the route still empty? if( !is_array(self::$route) ) { //Indeed, return nothing return; } //Make our mod and controller into a url string that complies //with our rules $urlString = $controller . '/' . $mod; //foreach loops are very break friendly so we're going to make use of a //while loop which continues until the end of the array or if a result //is found and succesfully replace $continue = true; while( (list($ruleKey, $ruleValue) = each(self::$route)) && $continue ) { if( array_key_exists($ruleKey, self::$isPlain) ) { $tmpString = str_replace($ruleKey, $ruleValue, $urlString); if( $tmpString !== $urlString ) { $urlString = $tmpString; $continue = false; } }else{ //Make sure we're not messing with a regex string if( !array_key_exists($ruleKey, self::$isRegex) ) { $ruleKey = str_replace('/', '\/', $ruleKey); } //Check if the string is a match if( preg_match( '/' . $ruleKey . '/', $urlString) && $continue == true ) { //It is so repalce it and break the loop $urlString = preg_replace( '/' . $ruleKey . '/', $ruleValue, $urlString); $continue = false; } } } //now break the url string again and return the controller, the function, and the variables $return = array(); $urlString = explode('/', $urlString); $url = count($urlString)-1; //Build an array with our controller, method, and varaibles for input $return['controller'] = $urlString[0]; $return['method'] = $urlString[1]; for($i = 2; $i <= $url; ++$i) { $return['vars'][] = $urlString[$i]; } return $return; } } but i didn't understand exacly what it does how it does.. -
Hello everyone few days ago i was reading about codeigniters routing system and after that i`ve start searching google about other routing systems and stuff like that. While i was searching i found out something interesting. $cfg['routing']['url']['products/:alphanum'] = 'store/products/:result'; $cfg['routing']['url']['product\/[a-z]'] = 'store/products/$1'; $cfg['routing']['url']['categories/:num/:alphanum-:num'] = 'store/categories/:result/:result/:result'; can please someone explain to me how this routing system is made maybe a small explained example ? thank you very much
-
<div id="example"> <a href="pl_user.php" target="_self">click here</a> </div> i think before you start using CSS you should revise your HTML knowledge because.. target="test" doesn`t exist target can be _blank, _parent, _self, _top and if i do remember quite well(it`s been a long time since i`ve read the manual i think you will find there a reference about framesets. If you don`t have a manual you should use this one HTML Manual P.S this topic should be in HTML Help Area.
-
the solution i would choose would be using mysql and add few more tables then just coins.. to keep track of the actions made by a user.. how many coins and stuff like that.. been used left.. depends on what you want.
-
mvc what m stands for what v stands for what c stands for
fantomel replied to fantomel's topic in Miscellaneous
There's a significant difference between understanding the theory of the MVC pattern and actually creating/coding your own. There's a lot more then just the theory you will have to know. This kind of reminds me of a boss at my previous job, he knew minimal programming but was more so into business/marketing aspect. He understood exactly what to do and how things worked, just not how to turn his ideas and concepts into actual code. I would definitely recommend becoming familiar with a popular framework first. 2 days in a row without internet.. puff.. stayed all day around .. and did nothing... in the mean time i started and thinked about what you said guys.. and .. :-? i`ve build a pretty nice simple skeleton .. probably tomorrow i will post it here.. -
he is right optimize them and then for each add a download link as full quality picture i would say :-?
-
before i see this i wanted to make you an example how should you do the class instantiate and use it but since your language is not appropriate with the rules here and the respect for others.. continue breaking nuts cuz all you gonna do is make everyone angry the first response you had the guy told ya that first you have to access the class(instantiate) and hold it under a variable it was nothing wrong your answer it had to be quite simple i`m sorry i tried that and didn`t work. ohh for the record sams teach you php doesn`t contain anything about OOP it teaches you only php and if would read a book about OOP the first thing it teaches you is how to create your first class return the simple Hello World and instantiate.. it makes you three times a liar and that not a lucky number.. maybe you should first apologize to the guys here who took 5 minutes from their time to read your post and try to help ya out;)
-
i think your code is fine your host has problems with bandwidth for some users and your pictures which are high quality .. make it harder to load.
-
Hello i'm trying to build a simple handler function for including files from different directorys what kind of security checking should i do before including the file ? any advices?
-
mvc what m stands for what v stands for what c stands for
fantomel replied to fantomel's topic in Miscellaneous
hmm. i was thinking like that but i wasn't sure that i`m correct because of my mess in the head after reading so much code written by others as someone said it doesn`t matter how you do it the final product it`s important. -
mvc what m stands for what v stands for what c stands for
fantomel replied to fantomel's topic in Miscellaneous
i have read your example there and i have searched the forum for other related problemes about implementing the mvc pattern i have found some nice things that helped me alot in better understanding of the implementation. probably after i will finish the basic implementation and stuff like that i will post here the code with comments and other stuff maybe someone will need it to and for taking grades from the "gods" in php ; -
you could build a simple cms with a photo gallery and for the dropdown menu you can use some css google
-
Well it really does depends, but yeah by defaut i would go for file and folder, but their have been cases where a database blob was better. it's good to know that sometimes it's better usign blob
-
mvc what m stands for what v stands for what c stands for
fantomel replied to fantomel's topic in Miscellaneous
the theory i`ve understand it how it works between controller viewer and model the data from the user(view) goes to the controller(like a backend of the site the engine) - and the model is equal with a class that helps the controller to do different stuff like a mysql class or a validation class for forms.. I have read different tutorials about creating a mvc based framework but all of them had a different aproach and just became a mess in my head... that's why i asked here for an example of implementation in pseudo code or direct code because i don't get it what should controller do.. Daniel0 as for ZF i`ve played a little and looked over tutorials and his code it is brilliant i makes you wonder why should you build your own framework when ZF has everything a coder would need but it`s pretty nice to learn how things work and stuff like that. -
mvc what m stands for what v stands for what c stands for
fantomel replied to fantomel's topic in Miscellaneous
anyone?:-s -
Run PHP Script at specified time (HH:MM:SS)
fantomel replied to milosh012's topic in PHP Coding Help
from the example i`ve seen it`s what you want to run a certain php script at a given hour minute and second i think the problem you are having is that you don`t know what you want Daniel0 gave you the perfect example including a website and an explanation -
mvc what m stands for what v stands for what c stands for
fantomel replied to fantomel's topic in Miscellaneous
yes i know that i could use a framework like zend or code igniter or symphony but i want to build my own framework from scratch and use it and maybe with time release it an try to create a community around with people who would love to help on developing the code. P.S can you add an example of code for each to see the implementation ? because from all the tutorials and diagrams i have seen and read i didn't understand anything. just that we have a base controller that extends the controller or controllers for our website where we write the logical part like getting stuff from mysql and deploy in the viewer -
Hello i have read a lot about mvc model - view - controller but in the end i didn't quite get the things you can do. i`m referring i didn't understand how it is implemented using php and what each thing should contain and should do... My request is if someone can help me with an example and stuff like that i would appreciate alot
-
please use php /php between []
-
PHP: POST displayed db $row from page to new page
fantomel replied to scentofindie's topic in PHP Coding Help
could you please provide more code ? and the error you are having if you don't have error_reporting on please error_reporting(E_ALL); ini_set('display_errors', 'On'); and tell us the error you are having.