Jump to content

rem

Members
  • Posts

    42
  • Joined

  • Last visited

    Never

Everything posted by rem

  1. Hello, I was struggling with this one for some time and can't find a solution. Can anyone advice how to keep the nice URLs while I'm navigating out of the current rule page. ex: for index.php page I have the following rule: RewriteRule ^(.*).html$ index.php?p=$1 [L] which allows me nice URLs like: about_us.html, instead of index.php?p=about_us but what if I need to go to another page (or link to another page) like gallery.php?g=50 from index.php? What should I do to have the links like that instead of gallery.php?g=50 Thanks a lot and I really hope this makes sense. Regards, Rem.
  2. this is what i did function focuss (id) { var divs = document.getElementsByTagName('DIV'); //lets say each one has a classname of focus div var count = divs.length; //do this here instead of inside of the loop for (var i = 0; i < count; i++) { if (divs[i].className == 'focus_div'){ divs[i].onclick = highlight(id); } } } function highlight(id) { //use this space to reference your funtion that will handle the highlighting document.getElementById(id).style.borderColor = '#ff0000'; } and the html <div id="pb-header" class="focus_div" onclick="focuss('pb-header');"> text here </div> <div id="pb-bg-heading" class="focus_div" onclick="focuss('pb-bg-heading');"> some text here </div> even though the IDs are pointless here sine we're triggering the focus state with the "focus_div" class but there's no other method I'm aware of to make it happen otherwise... I'm really sorry for bothering you like this but unfortunately my javascript knowledge are almost none please advice how to go further.. thanks!
  3. Thanks a lot for the latest post and I'm sorry for the late reply... I was away for one week. I'll see about that on Monday and post the result here asap. Thanks once again.. Best, Rem.
  4. Yes, that's about what I need! Thanks for the tip... very interesting indeed!
  5. <script type="javascript"> startDivs = function () { var divs = document.getElementsByTagName('DIV'); //lets say each one has a classname of focus div var count = divs.length; //do this here instead of inside of the loop for (var i = 0; i < count; i++) { if(divs.className == 'focus_div'){ divs.onclick = function() { //use this space to reference your function that will handle the highlighting alert('asdasda'); } } } } window.onload=startDivs; </script> <div class="focus_div">click me 1</div> <div class="focus_div">click me 2</div> this is what i've done but unfortunately it is not working what on earth am i doing wrong? thanks for the help!
  6. As far as I know, in IE, hover is not functional for other elements than links but I really don't understand what are you suggesting... I don't need a CSS hover behavior and don't need a CSS general styling of the DIVs... What I need is when a DIV is clicked to be highlighted by JavaScript (already accomplished) and when other DIV is clicked, then the initial highlighted DIV looses focus (it's style is cleared) and the last clicked DIV is highlighted and so on... Thank you..
  7. Hey, I manage to come up with this (there are no radio buttons involved just divs. i said "radio button" like functionality): function focuss(id) { if (document.getElementById(id)) { highlight(id); } } function highlight(id){ document.getElementById(id).style.borderColor = '#ff0000'; } Now the clicked DIV is highlighted but the big questions is... how to clear the rest of the styles and highlight only the current one? If I click a new DIV, that's also highlighted and the next one as well until I highlight all of the DIVS... The "active" DIV only should be highlighted, rest of them should be cleared once the focus is lost. Thanks a lot for your help emehrkay, I really appreciate it. Regards, Rem.
  8. This sounds... like it I will try to wizard it into a solved topic. Thanks a lot for your time, I really appreciate it. Promise I'll get back with the result
  9. Hello all, I'm trying for a few days to do something with javascript but this is not my strong point at all and I failed each time miserably so I thought to ask for help here. Please point me to a good tutorial or help me to achieve a "radio button" like behavior for a bunch of block level elements. ex: onclick a div is highlighted and then cleared when other one is clicked (this is to show users that certain part of an application has gain focus) Thank you very much in advance and looking forward for your advice. Regards Rem.
  10. Yes, indeed ... such a great idea and so simple. I don't know why i thought it should be very complicated... Thanks!
  11. Hello all, Could you please be that kind and point me to tutorial or let me know where to find out how to start building a basic template system for a ticketing system application emails? Something like: Dear %user_name%, Your ticket regarding the issue with %ticket_subject% etc.. etc... Thank you, Rem.
  12. i'm really sorry, i wasn't asking you to do it for me... i really don't know how, but i'll try harder. thanks for all your help!
  13. And another thing is that if a lower level of links is added, a sub-sub link, the script is displaying another main link with a child, instead of hierarchically display it along the tree... ex: [1] => title.html [2] => Array ( [0] => subtitle1.html ) [3] => Array ( [0] => subsubtitle1.html // this should be a child of subtitle1.html ) )
  14. That's perfectly fine! This is how i need it to do. This code is great, thanks a mil, except instead of links I have numbers! The array needs to be Array ( [menu1] => title.html [menu2] => Array ( [submenu3] => subtitle1.html ) ) instead of Array ( [1] => title.html [2] => Array ( [0] => subtitle1.html ) )
  15. Thanks a lot for your answer but that's not what I meant. It's my fault, I had to explain it better: Let's consider the following MYSQL records: ID title path parent =========================== 1 menu1 path1.html 0 2 menu2 path2.html 0 3 menu3 path3.html 0 4 submenu1 path4.html 3 5 submenu2 path5.html 3 and so on... I need those records fetched from MYSQL and hierarchically inserted into a multidimensional array to be like the one in the example above. That's the transformation I need! MySQL data -> Array() ... Thanks!
  16. Hi all, There's been a while since me and PHP got acquainted but still there's only a few month though since I started digging into arrays and theirs functionality. Since I'm here, of course there's a problem and I would like to ask you, more experienced guys, for help. I need to develop my own navigation system with unlimited levels of hierarchical links and I need to get them as a multidimensional array: <?php $menu = array ( 'menu 1' => 'path1.html', // main link where parent = 0 and ID 1 'menu 2' => 'path2.html', // main link where parent = 0 and ID 2 'menu 3' => array('submenu1' => 'subpath1.html', 'submenu1' => 'subpath1.html') // main link with ID 3, sub-links with parent = 3; // and so on ..... ); ?> Just in a few easy steps: how could I insert this data into MYSQL and then fetch it into an above like array? Further, I have a function which is recursively digging into the array and is displaying me the links as a tree. Which is exactly what I need to do, but I'm stuck when is about to handle the MYSQL part ... Thank you very much for all the help provided and for reading this! Regards, Rem.
  17. Hello, I'm having a nightmare here trying to figure out how could I bulk resize pictures but before uploading on server. For example if a user wants to upload on the server 10 imgs, 1M each, my script should resize them to 100 x 100 before! How could i do that?  ??? Thanks a lot!
  18. Yeap, it worked! Thanks a lot ProjectFear. I could swear I tried that myself and it didn't then...  Anyway, I'm sure must been screw things up somehow.
  19. [quote author=ProjectFear link=topic=114514.msg465938#msg465938 date=1163156538] whats with the public stuff. just do var $value; and remove the public from the start of the function. it probably wont effect anything but i find that code annoying for some reason.. now... Instead of calling it by $test->my_pattern() from inside the function call it like $this->my_pattern() if thats what your wanting to no. [/quote] Thanks a lot, I'll give that a try ... but that "public stuff" isn't how PHP5 handles it now?
  20. Hello, Could you please point me towards the right path here? I have a PHP5 class with multiple functions. Somehow, within those functions, there is a pattern which is repeated across the code. I thought, why not do a function to take care of the pattern and call it within the other functions whenever is needed ? ex: [code]<?php Class Example {     public $value;     public function my_pattern() {         //do something with $this->value;     }     public function some_other_function() {         $test = new Example;     //do something with $test->my_pattern();   } } ?>[/code] I don't know what am I doing wrong but $this->value is not assigned within my_pattern() function ... My head hurts bad ... Please help  ??? :'(... Thank you very much!
  21. [quote author=Jenk link=topic=112039.msg454834#msg454834 date=1161334120] If you are using MySQL.. why don't you separate into different columns, instead of [language:en]blah?! [/quote] I thought about that but users will have to choose their language from a dropdown, then insert a new post for each language and I want to keep it simple within the same post, everything in the same editor window. This is an ideea I got from the Polyglot WordPress plugin and I found it to be very practicable. I'm developing this for people who needs their websites content translated into multiple languages and besides that, I think it's pretty neat, eh? :)
  22. [quote author=Jenk link=topic=112039.msg454721#msg454721 date=1161301880] I meant use XML to store the data. [/quote] Oh, yes, that's a pretty good idea, but I'm already using MySQL to hold my posts and the above seemd to be the easier solution to deal with it... Thank you.
  23. [quote author=effigy link=topic=112039.msg454718#msg454718 date=1161300857] [code]$pattern = '/\[language:([a-z]{2})\](.+?)\[\/language:\1\]/';[/code] [/quote] WOW!!! Thanks a mil obsidian and effigy, you guys really ROCK! My stuff is working now!! WOW, that's so sweeet :)
  24. [quote author=Jenk link=topic=112039.msg454711#msg454711 date=1161299792] Why not use XML? [/quote] Not quite sure, how... would that be more helpful than PHP? I think I'd rather stick with what I already got. If I'll manage to solve the regex mistery somehow, it would probably work too :)
  25. I used obsidian's example (thank you) and played a bit with the pattern but didn't went to far, and few hours later, here I am , giving up... :( Can you help please? My code looks like this now: [code]<?php $string = '[language:en] Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam [/language:en]<br /> [language:es] Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam [/language:es]<br /> [language:fr] Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam [/language:fr]<br />'; $pattern = '/\[language:([a-z]{2})\]|\[\/language:$1\]/'; preg_match_all($pattern, $string, $matches, PREG_SET_ORDER); for ($i = 0; $i < count($matches); $i++) {   echo "<p>Language: " . $matches[$i][1] . "<br />\n";   echo "Text:<br />" . $matches[$i][2] . "</p>\n"; } ?>[/code] and all I managed to get from it is: Language: en Text: Language: es Text: Language: fr Text: (the actual text, obviously isn't displayed) Thanks a lot!
×
×
  • 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.