Jump to content

balkan7

Members
  • Posts

    234
  • Joined

  • Last visited

Everything posted by balkan7

  1. hi rhodesa, this is code for create thumbnails, but i have tested on FF working great, in IE cannot create only jpg thumbnail. on gif i have changed code to: <?php else if($_FILES['slika']['type'] == "image/gif"){ ?> and now working on IE, only jpg, jpeg cannot create thumbnails.
  2. Hi guys, i really confused why this code doesn't work on IE, i have tested on FF working fine. code is: <?php if (isset($_FILES['slika']['name']) and $_FILES['slika']['name'] != ""){ if (is_uploaded_file($_FILES['slika']['tmp_name'])) { $types = array(".jpeg", ".JPEG", ".jpg", ".JPG", ".gif", ".GIF", ".png", ".PNG"); $ext = strtolower(strrchr($_FILES['slika']['name'], ".")); $slika = strtolower($_FILES['slika']['name']); if (file_exists("../sliki/galerija/".$slika)){ $novo_ime = time(); $slika = $novo_ime . strtolower($_FILES['slika']['name']); } $slika_temp = $_FILES['slika']['tmp_name']; $mesto = "../sliki/galerija/".$slika; if (in_array($ext, $types)) { move_uploaded_file($slika_temp, $mesto); } $pat = $slika; $slika_org = "../sliki/galerija/". $slika; $snimi = "../sliki/galerija/slikicki/". $slika; list($width, $height) = getimagesize($slika_org); $sirina = 140; //$diff = $width / $sirina; $visina = 115; if ($_FILES['slika']['type'] == "image/jpg" or $_FILES['slika']['type'] == "image/jpeg"){ $tn = imagecreatetruecolor($sirina, $visina) ; $image = imagecreatefromjpeg($slika_org) ; imagecopyresampled($tn, $image, 0, 0, 0, 0, $sirina, $visina, $width, $height) ; imagejpeg($tn, $snimi, 100) ; } else if($_FILES['slika']['type'] == ".gif" or $_FILES['slika']['type'] == ".gif"){ $tn = imagecreatetruecolor($sirina, $visina) ; $image = imagecreatefromgif($slika_org) ; imagecopyresampled($tn, $image, 0, 0, 0, 0, $sirina, $visina, $width, $height) ; imagegif($tn, $snimi, 100) ; } $slikicka = "slikicki/". $pat; } } else { $slika = ""; $slikicka = ""; } ?>
  3. i dont know what can i say, i cant find solution, have tried many times just popup one video for other i get javascript error ... My question is: i need help for this one, another solution ???
  4. Strange i used popup in my php code but only work on FF doesn't work on IE. code is: <?php echo "<script type='text/javascript'> function popup(url, title,w,h) { var left = (screen.width/2)-(w/2); var top = (screen.height/2)-(h/2); var targetWin = window.open (url, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left); } </script>"; ?> and links code: <?php echo "<a href=\"javascript:void(0);\" onClick=\"popup('watch.php?video=".$video->url."', '".$video->title."', '620', '480');\">TEST</a>";
  5. i need help to fix this errors: Notice: Undefined offset: 0 in C:\xampp\htdocs\cool\video\includes.php on line 116 Notice: Undefined offset: 0 in C:\xampp\htdocs\cool\video\includes.php on line 123 Notice: Undefined offset: 0 in C:\xampp\htdocs\cool\video\includes.php on line 127 to include file i get errors mostly in code -> $video = $Videos[$i]; so includes.php is: <?php /*======================================================================*\ || VideoGalerija v1.01 || || -------------------------------------------------------------------- || || Copyright 2008. All rights reserved. || \*======================================================================*/ //include("utils.php"); #DEBUG /*define(BROWSE_VID, 1); define(BROWSE_IMG, 3); define(BROWSE_TITLE, ; define(BROWSE_RUNTIME, 10); define(BROWSE_POSTDATE, 13); define(BROWSE_USERNAME, 15); define(BROWSE_VIEWS, 17); define(BROWSE_STAR1, 19); define(BROWSE_STAR2, 21); define(BROWSE_STAR3, 23); define(BROWSE_STAR4, 25); define(BROWSE_STAR5, 27); define(BROWSE_RATINGS, 29); define(SEARCH_VID, 1); define(SEARCH_IMG, 3); define(SEARCH_TITLE, 7); define(SEARCH_DESC, 11);*/ function getVEntries($pageText){ //preg_match_all('|\<div class=\"vEntry\">(.*?)\<\/div/> \<\!-- end vEntry --\>|',$pageText,$ventries); //preg_match_all('|\<div class\=\"vEntry\"\>(.*)\<\/div\> \<\!-- end vEntry --\>|',$pageText,$ventries); print $pageText; preg_match_all('|\<div class=\"v120vEntry\"\>(.*?)\<\/div\> \<\!-- end vEntry --\>|s',$pageText,$ventries); //print_r($ventries[1]); } CLASS YouTube { var $_Results; var $_ResultCount; function Browse($select = "mp", $time = "t", $category = "0" , $page = "1") { $results = file("http://www.youtube.com/browse?s=".$select."&t=".$time."&c=".$category."&l=&p=".$page); $results = implode("", $results); preg_match_all('|\<div class=\"v120vEntry\"\>(.*?)\<\/div\> \<\!-- end vEntry --\>|s',$results,$ventries); $this->videos=array(); foreach ($ventries[1] as $ventryText){ $this->videos[]=new vEntry($ventryText); } /* if ($select == "mr") { preg_match_all('/\<a href=\"\/watch\?v=(.*?)\" (.*?)\>\<img src=\"(.*?)\" class=\" vimg \" alt=\"(.*?)\" \/\>\<\/a\>(.*?)<div class="vtitle">(.*?)\<a href=\"\/watch\?v=(.*?)\"\>(.*?)\<\/a\>\<br\/\>(.*?)\<span class=\"runtime\"\>(.*?)\<\/span\>(.*?)\<div class=\"vfacets\"\>(.*?)\<span class=\"grayText\"\>Added:\<\/span\> \<script type=\"text\/javascript\"\>document.write\(format_time_ago\((.*?)\)(.*?)href=\"\/user\/(.*?)\"\>(.*?)Views:\<\/span\> (.*?)\<br\/\>/s', $results, $matches); } else { preg_match_all('/\<a href=\"\/watch\?v=(.*?)\" (.*?)\>\<img src=/', $results, $matches); } $this->_Results = $matches; //preg_match_all('/\<div class=\"headerTitleRight\"\> Videos (.*?)-(.*?) of (.*?)\<\/div\>/', $results, $matches); $this->_ResultCount = $matches[3][0];*/ } function Search($query, $page='1', $type='search_videos', $sort='relevance', $category = "0") { $query=urlencode($query); $url = "http://www.youtube.com/results?search_query=".$query."&page=".$page; if ($category) { $url .= "&search_category=".$category; } if ($sort) { $url .= "&search_sort=".$sort; } if ($type) { $url .= "&search_type=".$type; } $results = file($url); $results = implode("", $results); //print($results); preg_match_all('|\<div class=\"vEntry\"\>(.*?)\<\/div\> \<\!-- end vEntry --\>|s',$results,$ventries); $this->videos=array(); foreach ($ventries[1] as $ventryText){ $this->videos[]=new searchvEntry($ventryText); } /* preg_match_all('/\<a href=\"\/watch\?v=(.*?)\" name=\"(.*?)\"\>\<img src=\"(.*?)\" class=\"vimg120\" \/\>\<\/a\>(.*?)<div class="vtitle">(.*?)\<a href=\"\/watch\?v=(.*?)\"\>(.*?)\<\/a\>\<br\/\>(.*?)\<div class=\"vdesc\"\>(.*?)\<span id=\"(.*?)\"\>(.*?)\<\/span\>/s', $results, $matches); $this->_Results = $matches; preg_match_all('/\<div class=\"headerTitleRight\"\>(.*?)\<b\>(.*?)\<\/b\>-\<b\>(.*?)\<\/b\> of \<b\>(.*?)\<\/b\>/s', $results, $matches); $this->_ResultCount = $matches[4][0];*/ } function ResultCount() { return $this->_ResultCount; } function Results() { //no longer used return $this->_Results; } function Videos() { //print_r($this->videos); return $this->videos; } //nastiness brought in from search.php function GetSearchResults($search_query, $page) { return $this->Search($search_query,$page); /* $search_query = str_replace(" ", "+", $search_query); $results = file("http://youtube.com/results?search_type=search_videos&search_query=".$search_query."&search_sort=&search_category=0&page=".$page); $results = implode("", $results); preg_match_all('|\<div class=\"v120vEntry\"\>(.*?)\<\/div\> \<\!-- end vEntry --\>|s',$results,$ventries); $this->videos=array(); foreach ($ventries[1] as $ventryText){ $this->videos[]=new vEntry($ventryText);*/ } /* preg_match_all('/\<a href=\"\/watch\?v=(.*?)\" (.*?)\>\<img src=\"(.*?)\" border=\"0\" class=\"vimg120\" \/\>\<\/a\>(.*?)<div class="vtitle">(.*?)\<a href=\"\/watch\?v=(.*?)\"\>(.*?)\<\/a\>\<br\/\>(.*?)\<div class=\"vdesc\"\>(.*?)\<span id=\"(.*?)\"\>(.*?)\<\/span\>/s', $results, $matches); $this->_Results = $matches; preg_match_all('/\<div (.*?)\>Results (.*?)-(.*?) of (.*?)\<\/div\>/s', $results, $matches); $this->_ResultCount = $matches[4][0];*/ //} } function displayVideos($Videos){ $columns = "4"; $rows = "5"; $vpp = $columns * $rows; echo '<table align="center" width="750" border="0" cellspacing="5" cellpadding="5" style="font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;">'; $i = 0; $video = $Videos[$i]; /* print "<hr><br/><b>Text</b>".$video->text; print "<br/><b>URL</b>".$video->video; print "<br/><b>Image</b>".$video->image; print "<br/><b>Title</b>".$video->title; */ for($r=0; $r<$rows; $r++) { $video=$Videos[$i]; echo '<tr>'; for($c=0; $c<$columns; $c++) { echo '<td valign="top" width="130">'; if($Videos[$i]){ $video=$Videos[$i]; if (isset($_GET['s']) and $_GET['s'] == "mr") { echo '<a href="pogledni.php?video='.$video->url.'"><img src="'.$video->image.'" border="0" width="130" height="97" /><br />'.$video->title.'</a><br />'.$locale['YT022'].' <script type="text/javascript">document.write(format_time_ago('.$video->postdate.'));</script><br />'.$locale['YT023'].' '.$video->views; } else { echo '<a href="pogledni.php?video='.$video->url.'"><img src="'.$video->image.'" border="0" width="130" height="97" /><br />'.$video->title.'</a><br />'.$locale['YT022'].' <script type="text/javascript">document.write(format_time_ago('.$video->postdate.'));</script><br />'.$locale['YT023'].' '.$video->views.'<br /><img src="http://youtube.com'.$video->star1.'" /><img src="http://youtube.com'.$video->star2.'" /><img src="http://youtube.com'.$video->star3.'" /><img src="http://youtube.com'.$video->star4.'" /><img src="http://youtube.com'.$video->star5.'" /><br />'.$locale['YT024'].' '.$video->ratings; } } echo '</td>'; $i++; } } echo '</table><div align="right" style="padding-right: 25px">'; } class searchvEntry{ //yes, this should probably be extending vEntry. maybe later //For now, the only differences are the regexps for the url and the function __construct($text){ $this->text=$text; preg_match('|<div class="vSnippetTitle">(.*?)\<a href=\"\/watch\?v=(.*?)\"\>(.*?)\<\/a\>|s',$this->text,$titles); $this->title=$titles[3]; preg_match('|\<a href=\"\/watch\?v=(.*?)\"|',$this->text,$vid); $this->url=$vid[1]; //better new name preg_match('|img src=\"(.*?)\" border=\"0\" class=\"vimg120\"|s',$this->text,$images); $this->image=$images[1]; preg_match('|\<span class=\"runtime\"\>(.*?)\<\/span\>|',$this->text,$runtimes); $this->runtime=$runtimes[1]; preg_match('|\<span class=\"runtime\"\>(.*?)\<\/span\>|',$this->text,$postdates); $this->postdate=$postdates[1]; preg_match_all('|\<img class=\"rating\" src=\"(.*?)\"|',$this->text,$stars,PREG_SET_ORDER); $this->views=''; $this->star1=$stars[0][1]; $this->star2=$stars[1][1]; $this->star3=$stars[2][1]; $this->star4=$stars[3][1]; $this->star5=$stars[4][1]; } } class vEntry{ function vEntry($text){ $this->text=$text; //preg_match('|div class=\"vtitle\"\>(.*?)\)\;\"\>(.*?)\<\/a\>\<\br\/\>|',$this->text,$titles); preg_match('|<div class="vtitle">(.*?)\<a href=\"\/watch\?v=(.*?)\"\>(.*?)\<\/a\>|s',$this->text,$titles); $this->title=$titles[3]; preg_match('|\<a href=\"\/watch\?v=(.*?)\"|',$this->text,$vid); $this->video=$vid[1]; //silly old name $this->url=$vid[1]; //better new name preg_match('|<img src=\"(.*?)\" class=\" vimg \"|',$this->text,$images); $this->image=$images[1]; preg_match('|\<span class=\"runtime\"\>(.*?)\<\/span\>|',$this->text,$runtimes); $this->runtime=$runtimes[1]; preg_match('|\<span class=\"runtime\"\>(.*?)\<\/span\>|',$this->text,$postdates); $this->postdate=$postdates[1]; preg_match_all('|\<img class=\"rating\" src=\"(.*?)\"|',$this->text,$stars,PREG_SET_ORDER); $this->views=''; $this->star1=$stars[0][1]; $this->star2=$stars[1][1]; $this->star3=$stars[2][1]; $this->star4=$stars[3][1]; $this->star5=$stars[4][1]; } /* here's the text we're matching <div class="v120vEntry"> <div id="QLContainer"> <div id="QLIcon"><a href="#" onClick="clicked_add_icon('8bbTtPL1jRs', 0);_hbLink('QuickList+AddTo','VidVert');return false;" title="Add Video to QuickList"><img id="add_button_8bbTtPL1jRs" border="0" onMouseover="mouse_over_add_icon('8bbTtPL1jRs');return false;" onMouseout="mouse_out_add_icon('8bbTtPL1jRs');return false;" src="/img/icn_add_20x20.gif" alt="Add Video to QuickList"></a></div> <div><a href="/watch?v=8bbTtPL1jRs"><img src="http://sjl-static7.sjl.youtube.com/vi/8bbTtPL1jRs/2.jpg" class=" vimg " alt="video" /></a></div> </div> <div class="vtitle"> <a href="/watch?v=8bbTtPL1jRs" onclick="_hbLink('MyChemicalRomanceFamousLastWords','VidVert');">My Chemical Romance - Famous Last Words</a><br/> <span class="runtime">04:27</span> </div> <div class="vfacets"> <span class="grayText">Added:</span> 3 months ago<br/> <span class="grayText">From:</span> <a href="/user/mYcheMicALroMaNcE">mYcheMicALroMaNcE</a><br/> <span class="grayText">Views:</span> 24657206<br/> </div> <img class="rating" src="/img/icn_star_full_11x11.gif" align="top"><img class="rating" src="/img/icn_star_full_11x11.gif" align="top"><img class="rating" src="/img/icn_star_full_11x11.gif" align="top"><img class="rating" src="/img/icn_star_full_11x11.gif" align="top"><img class="rating" src="/img/icn_star_half_11x11.gif" align="top"> <div class="rating ratingCount">20924 ratings</div> </div> <!-- end vEntry --> */ } ?> index.php <?php echo '<script type="text/javascript" src="http://youtube.com/js/browsePageTimeAgo_yts1157352107.js"></script>'; include("includes.php"); $yt = new YouTube; if (!isset($_GET['strana'])) { $Pages = 1; } else { $Pages = $_GET['strana']; } //$Search = $_GET[search]; if (!isset($_GET['s'])) { $Select = "mp"; } else { $Select = $_GET['s']; } //$yt->Search($Select,$_GET[t],$_GET[c],$Pages); $yt->Browse($Select,isset($_GET['t']),isset($_GET['c']),$Pages); //$TotalPages = $yt->ResultCount() / $vpp; if (isset($_GET['s']) and $_GET['s'] == "mr") { $TotalPages = 15; } else { $TotalPages = 5; } $Results = $yt->Results(); $Videos = $yt->Videos(); //print_r($Videos); displayVideos($Videos); $param = ""; foreach($_GET as $key => $value) { if (isset($key) and $key != 'strana') { if ($param != NULL) { $param .= "&"; } $param .= $key."=".$value; } }?>
  6. i change js code but nothing happens ??? radio.js var XMLHttpRequestObject = false; if (window.XMLHttpRequest) { XMLHttpRequestObject = new XMLHttpRequest(); } else if (window.ActiveXObject) { XMLHttpRequestObject = new ActiveXObject("Microsoft.XMLHTTP"); } function radio(page, DivID) { if(XMLHttpRequestObject) { var obj = document.getElementById(divID); XMLHttpRequestObject.open("GET", "radio_panel.php?page=" + page, true); XMLHttpRequestObject.onreadystatechange = function() { if(XMLHttpRequestObject.readyState == 1) { // Loading indicator obj.innerHTML = '<img src=\"images/loading.gif\">'; } if (XMLHttpRequestObject.readyState == 4 && XMLHttpRequestObject.status == 200) { obj.innerHTML = XMLHttpRequestObject.responseText; } } XMLHttpRequestObject.send(null); } } and html <a href=\"javascript:radio('strasnki', 'show');\">Stranski</a> <div id='show'>show here!!!</div>
  7. please help me data from clicked link. radio_panel.php <?php echo "<script type='text/javascript' src='radio.js'></script>"; openside("Radio"); echo "<table width='100%' cellpading='0' cellspacing='0' class='center'>\n<tr>\n"; echo "<td class='tbl1' witdh='50%'>Domasni</td>"; echo "<td class='tbl1' witdh='50%'><a href=\"javascript: page('stranski')\">Stranski</td>\n</tr>\n<tr>"; if (isset($_GET['page']) == "stranski"){ echo "<td class='tbl'><div id='radio'>Stranski radio stanici</div></td>"; } else { echo "<td class='tbl'>Domasni radio stanici</td>"; } echo "<tr>\n</table>\n"; closeside(); ?> and radio.js function getHTTPObject() { var xmlhttp; if(window.XMLHttpRequest){ xmlhttp = new XMLHttpRequest(); } else if (window.ActiveXObject){ xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); if (!xmlhttp){ xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); } } return xmlhttp; } var http = getHTTPObject(); // We create the HTTP Object /* */ function page(radio) { http.abort(); http.open("GET", "radio_panel.php?page=" + radio, true); http.onreadystatechange = function() { if(http.readyState == 1) { // Loading indicator document.getElementById('radio').innerHTML = '<img src=\"images/loading.gif\">'; } if(http.readyState == 4) { document.getElementById('radio').innerHTML = http.responseText; http.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); http.setRequestHeader("Content-length", param.length); http.setRequestHeader("Connection", "close"); } } http.send(null); }
  8. yes your right i confused with for() but now problem is solved thx again !
  9. trope this is php code, i need help to get result in two columns so i need php code for do it not html soryy....
  10. hi guys i need help to get result from yahoo weather in two columns like: Today Tomorow 2C 1C and other days currently i get result i new line so here is code anyone help! <?php for ($day=0; isset($weather_chile->forecast[$day]); $day++) { print "<h1>Forecast Day $day</h1>"; //print_r($weather_chile->forecast[$day]); print "day: ".$weather_chile->forecast[$day]['DAY']."<br>"; // Wed print "date: ".$weather_chile->forecast[$day]['DATE']."<br>"; // 26 Oct 2005 print "low °C: ".$weather_chile->forecast[$day]['LOW']."<br>"; // 8 print "high °C: ".$weather_chile->forecast[$day]['HIGH']."<br>"; // 19 print "text: ".$weather_chile->forecast[$day]['TEXT']."<br>"; // Partly Cloudy print "imgcode: ".$weather_chile->forecast[$day]['CODE']."<br>"; // 29=Image for partly cloudy print "image: <img src=http://us.i1.yimg.com/us.yimg.com/i/us/we/52/".$weather_chile->forecast[$day]['CODE'].".gif>"; print "<hr>"; } ?>
  11. i have created code for check username, but ajax nothing respond me code is: <script> function createRequestObject() { var req; if(window.XMLHttpRequest){ // Firefox, Safari, Opera... req = new XMLHttpRequest(); } else if(window.ActiveXObject) { // Internet Explorer 5+ req = new ActiveXObject("Microsoft.XMLHTTP"); } else { // There is an error creating the object, // just as an old browser is being used. alert('Problem creating the XMLHttpRequest object'); } return req; } var http = createRequestObject(); function useHttpResponseusername() { if (http.readyState == 4) { var textOut = http.responseText; var update = new Array(); document.getElementById('usercheck').innerHTML = textOut; if(textOut.indexOf('|' != -1)) { update = textOut.split('|'); document.getElementById(update[0]).innerHTML = update[1]; } } } function checkusername(username) { http.open('get', 'register.php?check=true&checkusername='+username+'&rand='+Math.random(), true); http.onreadystatechange = useHttpResponseusername; http.send(null); } </script> php code: <?php if(isset($_GET['check'])) { echo "<style type='text/css'> .quoteerror { color : #FFFFFF; background-color : #FF0000; border : 1px solid #C11B17; } </style>"; if(isset($_GET['checkusername'])) { $username = stripinput(trim(eregi_replace(" +", " ", $_GET['checkusername']))); if (!preg_match("/^[-0-9A-Z_@\s]+$/i", $username)) echo "<div class='quoteerror'><center>".$locale['403']."</center></div>"; $result = dbquery("SELECT * FROM ".DB_USERS." WHERE user_name='$username'"); if (dbrows($result) != 0) { $ajax_responde = "checkusername|<img src='images/icon_ajax_false.gif' border='0'> <span style='color: #FF0000;'>This username has already been taken</span>"; } else { $ajax_responde = "checkusername|<img src='images/icon_ajax_true.gif' border='0'> <span style='color: #008000;'>This username is still available.</span>"; } die(); } } ?> and <input type='text' name='username' maxlength='30' class='textbox' style='width:200px;' onChange='checkusername(this.value)' /><div id='usercheck'></div>
  12. i agree with you MadTechie, ok i create new table (activity with those fields: user_id, user_ip and user_activity) so i'm really confused when user logout what need inserting on field user_activity, when user again active delete old activity?, also on table users update last visit, i need just simple explame with code, insert in table activity and calculating but i cant get it
  13. i have to try with this options but i get this result: Activity: 32900% where i wrong, how can i get true result ? code is: <?php $timenow = time(); $minus = $timenow - $data['user_lastvisit']; $options = number_format($timenow / $minus)*100; ?>
  14. i cant find solution for this , also i got second table (online), -> online_user, online_ip and online_lastactive so maybe here must to be field activity but still need help when user logout what i need to write to field activity on datebase online? soryy i need this one...
  15. Soryy but i cant undestand again, we got 4 fields in datebase for checking user activity, -> UserId, UserJoined, UserLastvisit and UserActivity. so we begin when user is logout in datebase we iserting: $time = time(); $result = mysql_query("INSERT INTO users (UserId, UserLastvisit, UserActivity) values ("", "$time", "$time")"); here we got same time for last visit and acitvity, how can count... if you wanna explame me with code.
  16. yes but how can count script whitout user_lastacivity and time now?
  17. I need help to create code for user bar activity, i have in datebase this fields: user_id, user_joined, user_lastactivity user_status...., so need help with explame because i wanna get user bar activity like: username: admin activity: 80%
  18. i used php functions for datetime, php codes work perfectly but i add java script code for countdown minutes wait, doesnt work show nothing code java script is: <script language="JavaScript" type="text/javascript"> var theTime = document.getElementById('timer'); var sec = 01; // set the seconds var min = 10; // set the minutes function countDown() { sec--; if (sec == -01) { sec = 59; min = min - 1; } else { min = min; } if (sec<=9) { sec = "0" + sec; } time = (min<=9 ? "0" + min : min) + " min and " + sec + " sec "; if (document.getElementById) { theTime.innerHTML = time; } SD=window.setTimeout("countDown();", 1000); if (min == '00' && sec == '00') { sec = "00"; window.clearTimeout(SD); location.reload(true); } } function addLoadEvent(func) { var oldonload = window.onload; if (typeof window.onload != 'function') { window.onload = func; } else { window.onload = function() { if (oldonload) { oldonload(); } func(); } } } addLoadEvent(function() { countDown(); }); </script> php code for check time is: <?php if ($now < $check_date){ echo "<div id='timer'></div>"; }?> also did id corect for refresh page after minutes and seconds are 00:00 -> location.reload(true)
  19. Runs everyone who visited site, yes stored on datebase. This is for ads system just send mail to one member who got ads on site, so i need to limit send to mail notice once.
  20. how can i limit whitout another field in datebase ? because this code is located on main page and just check time when guest open the page, if i have 5 guests send 5 msg on mail
  21. How can i limit send to mail once, if i got on site more guests or members send many messages, i wanna to send just once. code is: // send msg 1 week before expire $now = time(); $week = $now+(60*60*24*7); $nextweek = date("Y-m-d H:i:s", $week); if ($data['expire'] <= $nextweek && $data['expire'] >=$now) { $to = $user_email; $from = "From:". $locale['M_EMAIL']; $msg = $locale['M_110'].$user_name."\n\n".$locale['M_111']; $subject = "Hello from ".$locale['M_SITE']; mail($to,$subject,$msg,$from); }
  22. Hello guys, how can i convert my java script code to ajax ? code is: echo "<script language=\"javascript\" type=\"text/javascript\"> function banner_types(banner_c_id) { if (banner_c_id == 0) { banner_id_0.style.display = 'block'; banner_id_1.style.display = 'none'; banner_id_2.style.display = 'none'; banner_id_3.style.display = 'none'; } else if (banner_c_id == 1) { banner_id_0.style.display = 'none'; banner_id_1.style.display = 'block'; banner_id_2.style.display = 'none'; banner_id_3.style.display = 'none'; } else if (banner_c_id == 2) { banner_id_0.style.display = 'none'; banner_id_1.style.display = 'none'; banner_id_2.style.display = 'block'; banner_id_3.style.display = 'none'; } else if (banner_c_id == 3) { banner_id_0.style.display = 'none'; banner_id_1.style.display = 'none'; banner_id_2.style.display = 'none'; banner_id_3.style.display = 'block'; } } </script>"; echo "<table class='tbl-border' cellpadding='0' cellspacing='1' align='center' width='80%' >\n<tr> <td class='tbl2'><b>".$locale['M_020']."</b>: </td> <td class='tbl1'><select name='banner_type' class='textbox' style='width:120px' onchange=\"banner_types(this.options[this.selectedIndex].value);\"> <option value='0'>".$locale['M_021']."</option> <option value='1'".(isset($_POST['add_banner']) && $banner_type == 1 ? " selected='selected'" : "").">".$locale['M_022']."</option> <option value='2'".(isset($_POST['add_banner']) && $banner_type == 2 ? " selected='selected'" : "").">".$locale['M_023']."</option> <option value='3'".(isset($_POST['add_banner']) && $banner_type == 3 ? " selected='selected'" : "").">".$locale['M_024']."</option> </select></td></tr> <tr> <td class='tbl1' align='center' colspan='2'> <div id='banner_id_0' style='display: block'></div> <div id='banner_id_1' style='display: none'><input type='text' name='banner_img' style='width:200px;' class='textbox'><span class='small2'><br>".$locale['M_025']."</span></div> <div id='banner_id_2' style='display: none'><input type='file' name='banner_file_img' class='textbox' style='width:250px;'><span class='small2'><br>".$locale['M_026']."</span></div> <div id='banner_id_3' style='display: none'><input type='file' name='banner_file' class='textbox' style='width:250px;'><span class='small2'><br>".$locale['M_027']."</span></div> </td></tr>";
  23. No errors show, just not display div blocks
  24. My code working only on IE, on Firefox not working, so what i need to do for work on Firefox. echo "<script language=\"javascript\" type=\"text/javascript\"> function banner_types(banner_c_id) { if (banner_c_id == 0) { banner_id_0.style.display = 'block'; banner_id_1.style.display = 'none'; banner_id_2.style.display = 'none'; banner_id_3.style.display = 'none'; } else if (banner_c_id == 1) { banner_id_0.style.display = 'none'; banner_id_1.style.display = 'block'; banner_id_2.style.display = 'none'; banner_id_3.style.display = 'none'; } else if (banner_c_id == 2) { banner_id_0.style.display = 'none'; banner_id_1.style.display = 'none'; banner_id_2.style.display = 'block'; banner_id_3.style.display = 'none'; } else if (banner_c_id == 3) { banner_id_0.style.display = 'none'; banner_id_1.style.display = 'none'; banner_id_2.style.display = 'none'; banner_id_3.style.display = 'block'; } } </script>"; echo "<table class='tbl-border' cellpadding='0' cellspacing='1' align='center' width='80%' >\n<tr> <td class='tbl2'><b>".$locale['M_020']."</b>: </td> <td class='tbl1'><select name='banner_type' class='textbox' style='width:120px' onchange=\"banner_types(this.options[this.selectedIndex].value);\"> <option value='0'>".$locale['M_021']."</option> <option value='1'".(isset($_POST['add_banner']) && $banner_type == 1 ? " selected='selected'" : "").">".$locale['M_022']."</option> <option value='2'".(isset($_POST['add_banner']) && $banner_type == 2 ? " selected='selected'" : "").">".$locale['M_023']."</option> <option value='3'".(isset($_POST['add_banner']) && $banner_type == 3 ? " selected='selected'" : "").">".$locale['M_024']."</option> </select></td></tr> <tr> <td class='tbl1' align='center' colspan='2'> <div id='banner_id_0' style='display: block'></div> <div id='banner_id_1' style='display: none'><input type='text' name='banner_img' style='width:200px;' class='textbox'><span class='small2'><br>".$locale['M_025']."</span></div> <div id='banner_id_2' style='display: none'><input type='file' name='banner_file_img' class='textbox' style='width:250px;'><span class='small2'><br>".$locale['M_026']."</span></div> <div id='banner_id_3' style='display: none'><input type='file' name='banner_file' class='textbox' style='width:250px;'><span class='small2'><br>".$locale['M_027']."</span></div> </td></tr>";
×
×
  • 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.