Jump to content

deepson2

Members
  • Posts

    260
  • Joined

  • Last visited

    Never

Everything posted by deepson2

  1. Hello, I want to display link on the page. i am fetching the data(URL) from database,actually before that i am checking if it is URL or not. if it is URL, let take an example google.com so it should take me directly on the Google's page after clicking on that link . but now the problem is the path is something like this. i want directly Here is my code if($row['which_mail'] == "decline") { if(!preg_match("/^[a-zA-Z]+[:\/\/]+[A-Za-z0-9\-_]+\\.+[A-Za-z0-9\.\/%&=\?\-_]+$/i",$row['content'])) { $ab = $row['content']; echo $ab ; // echo "<b>Last message for decline mail is</b>-".<a href='$ab'>".$row['content']."</a>."; echo "<a href='$ab'>".$row['content']."</a>"; }else{ $decline =$row['content']; echo "<b>Last message for decline mail is</b>- $decline"; }} Can anyone look into my code and tell me how can i achieve that? Thanks in advance.
  2. Hello, I have several mail functions on my site. time to time i need to change the message of those mails. Most of the time the content is almost same. So i just wanted to ask here that can we make some common template so i can put common mail body into it? and every time the mail function will be called, it should consider this template as well eg. this is the common code i want to put in each every mail function Can anyone tell me is this the right way to do this or i can do that in some different way? please point me in right direction. Thanks in advance.
  3. cache.php <?php ob_start(); // start the output buffer ?> hello world! <?php $cachefile = "abc.php"; $fp = fopen($cachefile, 'w'); // open the cache file "cache/home.html" for writing fwrite($fp, ob_get_contents()); // save the contents of output buffer to the file fclose($fp); // close the file ob_end_flush(); // Send the output to the browser $cachefile = "abc.php"; if (file_exists($cachefile)) { // the page has been cached from an earlier request include($cachefile); // output the contents of the cache file exit; // exit the script, so that the rest isnt executed } $cachetime = 5 * 60; // 5 minutes // Serve from the cache if it is younger than $cachetime if (file_exists($cachefile) && (time() - $cachetime < filemtime($cachefile))) { include($cachefile); echo "<!-- From cache generated ".date('H:i', filemtime($cachefile))." -->\n"; exit; } $cachefile = $reqfilename; $cachetime = 5 * 60; // 5 minutes // Serve from the cache if it is younger than $cachetime if (file_exists($cachefile) && (time() - $cachetime < filemtime($cachefile))) { include($cachefile); echo "<!-- Cached ".date('jS F Y H:i', filemtime($cachefile))." -->\n"; exit; } ob_start(); // start the output buffer $fp = fopen($cachefile, 'w'); // open the cache file for writing fwrite($fp, ob_get_contents()); // save the contents of output buffer to the file fclose($fp); // close the file ob_end_flush(); // Send the output to the browser $cachefile = $reqfilename; // Serve from the cache if it is the same age or younger than the last // modification time of the included file (includes/$reqfilename) if (file_exists($cachefile) && (filemtime("includes/".$reqfilename)) < filemtime($cachefile)){ include($cachefile); echo "<!-- Cached ".date('H:i', filemtime($cachefile))." -->\n"; exit; } ob_start(); // start the output buffer $fp = fopen($cachefile, 'w'); // open the cache file for writing fwrite($fp, ob_get_contents()); // save the contents of output buffer to the file fclose($fp); // close the file ?> ob_end_flush(); // Send the output to the browser abc.php hello world // it comes after i run the cache files. bit confusing to me. if i want to run particular query select info form mytable where active='1' Do i need to put it cache.php?but then actually user want to see abc.php bit confusing. can anyone check this code and tell me whats actually happening? abc.php is my actual page.
  4. ok, bit of i am started getting what chacheing is actually after reading this http://www.developertutorials.com/tutorials/php/php-caching/page1.html ok if i have abc.php page where i am showing of my mysql result which is not going to change according to user. so i can create cache for this page. but what content will come here i don't know. can anyone one explain me what ll come one this page and what i need to do here? Thanks
  5. Thanks for your reply neil, i so sorry i checked your both the links, but i didn't understand anything could you please tell me this in simple way? may be this is simple but just because my concept is not cleared yet(about cache) because of that i am not getting it.
  6. Thanks for your reply ToonMariner, Understood. but let say i have following query This query every time is gonig to chage according to the userid then how can i stored this select query in CACHE? and could you please show me how can i store this result into CACHE as well?
  7. Hello, I have just heard from someone that we can actually keep our select query into files so every time we don't have to run the query we can get that result form a file. I have got this similar link here http://www.phpfreaks.com/forums/index.php?topic=163810 But couldn't able to find out the useful resource for this concept. I have following queries. 1) How this method works actually.?(pretty But still want to learn about it) 2) is this applicable for only group by/order by queries? if No then how can we pass the particular ids in the text file (or only file, i don't know what we can call in this type of file) Why i want to do that is because if 1000 viewer are accessing a one particular page at time then the speed of the query let say 0.5 sec for each viewer will take then how much time page/query ll take to load? Some confusing random thoughts. Can any one know how to optimize your query? or can anyone tell me how can i optimize my code using files? Thanks in advance.
  8. hmm, I think there is no possible way that i can get back my content. anyways thanks a lot!
  9. Hello, Can anyone please tell me once i delete my table(by mistakenly ),is there any chance to get that content restore back. i have asked server side people but they have back up of 3 months back. is there anyways that we can restore the table ? please tell me
  10. I just want to look my toolbar like facebook has. so can anyone have live example of something like this?
  11. I don't think i will use both the interfaces. using fixed toolbar i can get the toolbar. and on that i can fetch whatever data(total comment, new shout) i would like to fetch( i hope this is what i am thinking right now..let see ) What would be your suggestion?
  12. Thanks for the reply to both of you. I was thinking something similar. but thing is i just wanted to see some site which has this kind of facilities. and secondly how can i get that toolbar? i don't want to use iframe here. Do you have any live example of this kinda of stuff?
  13. Hello, Can we do that face book like notification with php. I mean for website, once user logs in he/she can probably get the toolbar which will give him/her small recap kind of thing that. he/she is got new friend request, or got new comment. I have searched a lot. i thing face book have done that with API or something else?? Can anyone have worked on something like this? or any suggestion? :confused: Thanks in advance.
  14. Hello chris again, Thanks for your reply , I have solved my this problem . actually i forgot to mark this thread as solved one. anyways thanks for your reply.
  15. I have tried the mouse hover effect they have mentioned in comment area of this module. here it is http://woork.blogspot.com/2008/07/fantastic-news-ticker-newsvine-like.html?dsq=15850380#comment-15850380 Still its not working. Any help??
  16. Hello, I have given automatic scrolling effect for my recently updated feeds. this is the exact code which i have taken from the tutorial. but now i want on mouse hover the scrolling should stop moving. because sometimes its to fast so sometimes one can not read the content. here is the demo for it. http://woorktuts.110mb.com/newsticker/index.html now its not stopping on mouse hover. so i hv add onmousehover method into my js . here is my new JS(which is not working) var Ticker = new Class({ Implements : [Options], options : { speed: 1500, delay: 5000, direction: 'vertical' }, initialize: function(el,options){ this.setOptions(options); this.el = $(el).addEvents({ 'mouseover' : this.over.bind(this), 'mouseout' : this.out.bind(this) }); this.items = this.el.getElements('li'); var w = 0; var h = 0; if(this.options.direction.toLowerCase()=='horizontal') { h = this.el.getSize().y; this.items.each(function(li,index) { w += li.getSize().x; }); } else { w = this.el.getSize().x; this.items.each(function(li,index) { h += li.getSize().y; }); } this.el.setStyles({ position: 'absolute', top: 0, left: 0, width: w, height: h }); this.fx = new Fx.Morph(this.el,{duration:this.options.speed,onComplete:function() { var i = (this.current==0)?this.items.length:this.current; this.items[i-1].injectInside(this.el); this.el.setStyles({ left:0, top:0 }); }.bind(this)}); this.current = 0; this.next(); }, next: function() { this.current++; if (this.current >= this.items.length) this.current = 0; var pos = this.items[this.current]; this.fx.start({ top: -pos.offsetTop, left: -pos.offsetLeft }); this.timeoutId = this.next.bind(this).delay(this.options.delay+this.options.speed); }, over : function(){ this.fx.pause(); $clear(this.timeoutId); }, out : function(){ this.fx.resume(); this.next(); } }); window.addEvent('domready',function(){ var vert = new Ticker('TickerVertical',{speed:1000,delay:2000,direction:'vertical'}); }) can anyone plese tell me why its not working and how can i get my effect to be done? Thnaks in advance
  17. ok, thanks neil, can anyone else help me?
  18. ok,i removed them still getting same errors. what can i do? please help me.
  19. using error console, i have removed some error. here is my code <html> <head> <script type="text/javascript"> currentIndx=0; Messages=new Array() Messages[0]='We learn about our world through the 5 senses'; Messages[1]='We use our eyes to see things'; Messages[2]='Our ears to hear things' Messages[3]='And our sense of touch to feel things.'; imagesPreloaded = new Array(4) for (var i = 0; i < MyImages.length ; i++) { imagesPreloaded[i] = new Image(120,120) imagesPreloaded[i].src=MyImages[i] } /*###### function to write image number in sequence, eg 1 of 4*/ function writeImageNumber() { oSpan=document.getElementById("sp1"); oSpan.innerHTML="Image "+eval(currentIndx+1)+" of "+MyImages.length; } /* ####################### we create the functions to go forward and go back ####################### */ function Nexter(){ if (currentIndx<imagesPreloaded.length-1){ currentIndx=currentIndx+1; document.getElementById('text1').innerHTML=Messages[currentIndx]; } else { currentIndx=0 document.getElementById('text1').innerHTML=Messages[currentIndx]; } writeImageNumber(); } function Backer(){ if (currentIndx>0){ currentIndx=currentIndx-1; document.getElementById('text1').innerHTML = Messages[currentIndx]; } else { currentIndx=3 document.getElementById('text1').innerHTML = Messages[currentIndx]; } writeImageNumber(); } function automaticly() { writeImageNumber() document.getElementById('text1').innerHTML = Messages[currentIndx]; currentIndx=currentIndx+1; var delay = setTimeout("automaticly()",3500) } } /*###### function to reload the images and text when refresh is pressed ##### */ function setCurrentIndex() { currentIndx=0; document.getElementById('text1').innerHTML = Messages[0]; writeImageNumber(); } </script> </head> <body onload="setCurrentIndex();automaticly()"> <form NAME="form1" align="center"> <div id="text1" wrap="virtual"> We learn about our world through our 5 senses. </div> <input type="button" value="<< Previous" name="previous" onClick="Backer()"></td> <input type="button" value="Next >>" name="next" onClick="Nexter()"> <span id="sp1"></span> <div align="right"><p>Automatic:</p> <input type="checkbox" name="automatic" value="ON" onClick="automaticly()"> </div> </form> </body> </html> but still getting these two error Error: Backer is not defined Error: Nexter is not defined Line: 1 Line: 1 but its already define. so why its showing these error. could you please tell me.
  20. I have changed what you have suggested. but it seems its not working. <script type="text/javascript"> currentIndx=0; MyImages=new Array(); MyImages[0]='vulcano.gif'; MyImages[1]='eye.gif'; MyImages[2]='ear.gif'; MyImages[3]='hand.gif'; Messages=new Array() Messages[0]='We learn about our world through the 5 senses'; Messages[1]='We use our eyes to see things'; Messages[2]='Our ears to hear things' Messages[3]='And our sense of touch to feel things.'; imagesPreloaded = new Array(4) for (var i = 0; i < MyImages.length ; i++) { imagesPreloaded[i] = new Image(120,120) imagesPreloaded[i].src=MyImages[i] } /*###### function to write image number in sequence, eg 1 of 4*/ function writeImageNumber() { oSpan=document.getElementById("sp1"); oSpan.innerHTML="Image "+eval(currentIndx+1)+" of "+MyImages.length; } /* ####################### we create the functions to go forward and go back ####################### */ function Nexter(){ if (currentIndx<imagesPreloaded.length-1){ currentIndx=currentIndx+1; document.theImage.src=imagesPreloaded[currentIndx].src document.getElementById('text1').innerHTML=Messages[currentIndx]; } else { currentIndx=0 document.theImage.src=imagesPreloaded[currentIndx].src document.getElementById('text1').innerHTML=Messages[currentIndx]; } writeImageNumber(); } function Backer(){ if (currentIndx>0){ currentIndx=currentIndx-1; document.theImage.src=imagesPreloaded[currentIndx].src document.getElementById('text1').innerHTML = Messages[currentIndx]; } else { currentIndx=3 document.theImage.src=imagesPreloaded[currentIndx].src document.getElementById('text1').innerHTML = Messages[currentIndx]; } writeImageNumber(); } function automaticly() { if (document.form1.automatic.checked) { if (currentIndx<imagesPreloaded.length){ currentIndx=currentIndx } else { currentIndx=0 } writeImageNumber() document.theImage.src=imagesPreloaded[currentIndx].src document.getElementById('text1').innerHTML = Messages[currentIndx]; currentIndx=currentIndx+1; var delay = setTimeout("automaticly()",3500) } } /*###### function to reload the images and text when refresh is pressed ##### */ function setCurrentIndex() { currentIndx=0; document.theImage.src=MyImages[0]; document.getElementById('text1').innerHTML = Messages[0]; writeImageNumber(); } </script> <form NAME="form1" align="center"> <div id="text1" wrap="virtual"> We learn about our world through our 5 senses. </div> <input type="button" value="<< Previous" name="previous" onClick="Backer()"></td> <input type="button" value="Next >>" name="next" onClick="Nexter()"> <span id="sp1"></span> <div align="right"><p>Automatic:</p> <input type="checkbox" name="automatic" value="ON" onClick="automaticly()"> </div> </form> Could you plesse check it and tell me why its not working.?
  21. Thanks for your reply neil, As you may have seen my first code. i want to do somthing like that. but i dont want to use textarea there so just wanted to keep my div like the following <div id="text1"> We learn about our world through our 5 senses. </div> Could you please tell me how can i change my document.forms to document.getElementById ? so it ll work the same but without the textarea.
  22. Hello, I want to change my this line to this but it seems its not working. the first line represent and work fine for textarea. but i dont want to use textarea, i want to user div so just made the changes but its not working. here is my code with textarea. and its working fine <html> <head> <script type="text/javascript"> currentIndx=0; MyImages=new Array(); MyImages[0]='vulcano.gif'; MyImages[1]='eye.gif'; MyImages[2]='ear.gif'; MyImages[3]='hand.gif'; Messages=new Array() Messages[0]='We learn about our world through the 5 senses'; Messages[1]='We use our eyes to see things'; Messages[2]='Our ears to hear things' Messages[3]='And our sense of touch to feel things.'; imagesPreloaded = new Array(4) for (var i = 0; i < MyImages.length ; i++) { imagesPreloaded[i] = new Image(120,120) imagesPreloaded[i].src=MyImages[i] } /*###### function to write image number in sequence, eg 1 of 4*/ function writeImageNumber() { oSpan=document.getElementById("sp1"); oSpan.innerHTML="Image "+eval(currentIndx+1)+" of "+MyImages.length; } /* ####################### we create the functions to go forward and go back ####################### */ function Nexter(){ if (currentIndx<imagesPreloaded.length-1){ currentIndx=currentIndx+1; document.theImage.src=imagesPreloaded[currentIndx].src document.form1.text1.value=Messages[currentIndx]; } else { currentIndx=0 document.theImage.src=imagesPreloaded[currentIndx].src document.form1.text1.value=Messages[currentIndx]; } writeImageNumber(); } function Backer(){ if (currentIndx>0){ currentIndx=currentIndx-1; document.theImage.src=imagesPreloaded[currentIndx].src document.form1.text1.value=Messages[currentIndx]; } else { currentIndx=3 document.theImage.src=imagesPreloaded[currentIndx].src document.form1.text1.value=Messages[currentIndx]; } writeImageNumber(); } function automaticly() { if (document.form1.automatic.checked) { if (currentIndx<imagesPreloaded.length){ currentIndx=currentIndx } else { currentIndx=0 } writeImageNumber() document.theImage.src=imagesPreloaded[currentIndx].src document.form1.text1.value=Messages[currentIndx]; currentIndx=currentIndx+1; var delay = setTimeout("automaticly()",3500) } } /*###### function to reload the images and text when refresh is pressed ##### */ function setCurrentIndex() { currentIndx=0; document.theImage.src=MyImages[0]; document.form1.text1.value=Messages[0]; writeImageNumber(); } </script> </head> <body onload="setCurrentIndex();automaticly()"> <!-- ####################### start of form for image slide show ####################### --> <form NAME="form1" align="center"> <table BORDER="3"> <tr> <td><img SRC="vulcano.gif" NAME="theImage" HEIGHT="120" WIDTH="120"></td> /* The text area below has the initial value (same as Messages[0]). Later it changed by code*/ <td><textarea rows="4" name="text1" cols="20" wrap="virtual">We learn about our world through our 5 senses.</textarea></td> </tr> <tr> /* The following 2 buttons call the functions Backer() and Nexter(), explained above. */ <td><input type="button" value="<< Previous" name="previous" onClick="Backer()"></td> /* Don't forget the span, where the function writes the current image number!.(You can put this where you like) */ <td><input type="button" value="Next >>" name="next" onClick="Nexter()"> <span id="sp1"></span></td> </tr> <tr> <td><div align="right"><p>Automatic:</td> /* Finally, the check box calls the function 'automatically()' when it is clicked. */ <td><input type="checkbox" name="automatic" value="ON" onClick="automaticly()"> </td> </tr> </table> </form> <!-- ####################### end of form for image slide show ####################### --> </body> </html> now i want to get this done according to this code. but its not working <html> <head> <script type="text/javascript"> currentIndx=0; MyImages=new Array(); MyImages[0]='vulcano.gif'; MyImages[1]='eye.gif'; MyImages[2]='ear.gif'; MyImages[3]='hand.gif'; Messages=new Array() Messages[0]='We learn about our world through the 5 senses'; Messages[1]='We use our eyes to see things'; Messages[2]='Our ears to hear things' Messages[3]='And our sense of touch to feel things.'; imagesPreloaded = new Array(4) for (var i = 0; i < MyImages.length ; i++) { imagesPreloaded[i] = new Image(120,120) imagesPreloaded[i].src=MyImages[i] } /*###### function to write image number in sequence, eg 1 of 4*/ function writeImageNumber() { oSpan=document.getElementById("sp1"); oSpan.innerHTML="Image "+eval(currentIndx+1)+" of "+MyImages.length; } /* ####################### we create the functions to go forward and go back ####################### */ function Nexter(){ if (currentIndx<imagesPreloaded.length-1){ currentIndx=currentIndx+1; document.theImage.src=imagesPreloaded[currentIndx].src document.getElementById(text1).value=Messages[currentIndx]; } else { currentIndx=0 document.theImage.src=imagesPreloaded[currentIndx].src document.getElementById(text1).value=Messages[currentIndx]; } writeImageNumber(); } function Backer(){ if (currentIndx>0){ currentIndx=currentIndx-1; document.theImage.src=imagesPreloaded[currentIndx].src document.getElementById('text1').value=Messages[currentIndx]; } else { currentIndx=3 document.theImage.src=imagesPreloaded[currentIndx].src document.getElementById('text1').value=Messages[currentIndx]; } writeImageNumber(); } function automaticly() { if (document.form1.automatic.checked) { if (currentIndx<imagesPreloaded.length){ currentIndx=currentIndx } else { currentIndx=0 } writeImageNumber() document.theImage.src=imagesPreloaded[currentIndx].src document.getElementById('text1').value=Messages[currentIndx]; currentIndx=currentIndx+1; var delay = setTimeout("automaticly()",3500) } } /*###### function to reload the images and text when refresh is pressed ##### */ function setCurrentIndex() { currentIndx=0; document.theImage.src=MyImages[0]; document.getElementById('text1').value = Messages[0]; writeImageNumber(); } </script> </head> <form NAME="form1" align="center"> <div id="text1"> We learn about our world through our 5 senses. </div> <div> <input type="button" value="<< Previous" name="previous" onClick="Backer()"></td> <input type="button" value="Next >>" name="next" onClick="Nexter()"> <span id="sp1"></span></div> <div align="right"><p>Automatic:</p> <input type="checkbox" name="automatic" value="ON" onClick="automaticly()"> </div> </form> </html> Can anyone check my both the code and tell me how can i get my second code to work that is with div? Thnaks in advance
  23. I have tried the following effect. this is somthing i want but with text/feed here is the code <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>mootools demos - Periodical</title> <script type="text/javascript" src="mootools.svn.js"></script> <script type="text/javascript"> window.addEvent('domready', function(){ var effect = $('box').effect('background-color', {duration: 800}); var periodical; var fx = function() { effect.start('#6684a0').chain(function() { effect.start('#bcd965'); }); } $('start').addEvent('click', function() { fx(); periodical = fx.periodical(1700); }); $('stop').addEvent('click', function() { $clear(periodical); }); }); </script> <style> #box { margin: 1em auto; width: 200px; height: 150px; background: #bcd965; border: 1px solid #000; } </style> </head> <body> <div id="demo"> <h3>Periodical Effects</h3> <a id="start" href="#">start</a> | <a id="stop" href="#">stop</a> <div id="box"></div> </div> </div> <span class="clr"></span> </div> </div> </body> </html> Here colors are changinig so can anyone tell me how can i show the following text values one by one meera john vivek So i want meera will come first then john and then vivek so cycle ll be continues. actually i want to do somthing like this. can anyone have done this before on start button show all the feed http://twitspy.com/ please help me.
×
×
  • 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.