Jump to content

benji87

Members
  • Posts

    136
  • Joined

  • Last visited

    Never

Everything posted by benji87

  1. I fixed it guys. I needed to upgrade to the latest version of jquery. I was using an older version in order for a certain plugin to work.
  2. Thanks for all the articles. It's a real problem as I can't influence my users choice of browser etc and I need to fix the problem! As many users especially my target market may become concerned if an error like that pops up and are likely to close down the window and go elsewhere. Does anyone know of any fix I can try my end to stop this happening?
  3. I've looked at the link pornophobic but I can't see how that would be connected as it's not opening up an additional program it's simply opening a link. rwwd I've updated my script with what you posted. The semi colon is to close the else statement? I'm still having the same issue though
  4. Hi Guys, Been a while since I've been on the forums but I have a really bugging problem that I've never seen before. I have two websites one of which is http://www.get-xbox-kinect.co.uk which I have used the same php script for. The script fetches a link from the database when executed by the user clicking a external link. I have had reports from users saying that when they hit a link the external page loads up but at the same time an alert window appears saying 'not enough memory at line xx'. For some reason it seems to be a different line number for different users too. I can only confirm this happens in IE8 but I guess it will probably do the same thing in IE6 and 7 too. It is not an issue however in Firefox or Safari. Here is my exit link script <?php include('./globals.php'); $affiliate = $_GET['affil']; $user_ip = $_SESSION['user_ip']; date_default_timezone_set('Europe/London'); $date = date('D, d M Y H:i:s'); $entry_url = $_SESSION['referer']; $result = mysql_query("SELECT url FROM affiliate WHERE affiliate = '". $affiliate ."'") or die(mysql_error()); $row = mysql_fetch_array($result); $exitlink = $row[0]; if($user_ip == '00.00.000.00') { header("Location: " . $row["url"] . ""); } else { $result = mysql_query("UPDATE affiliate SET clicks = clicks +1 WHERE affiliate ='$affiliate'") or die(mysql_error()); mysql_query("INSERT INTO affiliate_clicks (affiliate, user_ip, date, entry_url) VALUES('$affiliate', '$user_ip', '$date', '$entry_url') ")or die(mysql_error()); header("Location: " . $row["url"] . ""); }; ?> Not sure if it actually has anything to do with this script or it's something else at play. I'm sure someone must have come across this problem before. Any help would be much appreciated! Thanks.
  5. Brilliant! I finally got it working! Thanks for all your help! I still got a blank page after using the final code u gave me. So i put all error reporting on and found that the code had the min and max font size missing! After that it worked fine.
  6. I just get a blank page? Here is my current code: <?php function get_tag_cloud() { include "db.php"; $minimum_count = 0; $maximum_count = 0; $result = mysql_query("SELECT tag, link, count FROM tags ORDER BY tag"); while($row = mysql_fetch_array($result)) { if ($row['count'] > $maximum_count) { $maximum_count = $row['count']; } if (!$minimum_count || $row['count'] < $minimum_count) { $minimum_count = $row['count']; } $tags[$row['tag']]['count'] = $row['count']; $tags[$row['tag']]['link'] = $row['link']; } $spread = $maximum_count - $minimum_count; if($spread == 0) { $spread = 1; } $cloud_html = ''; $cloud_tags = array(); // create an array to hold tag code foreach ($tags as $tag => $info) { $size = $min_font_size + ($info['count'] - $minimum_count) * ($max_font_size - $min_font_size) / $spread; $cloud_tags[] = '<a style="font-size: '. floor($size) . 'px' . '" class="tag_cloud" href="tagprocess.php?tag=' . $info['link'] . '" title="\'' . $tag . '\' returned a count of ' . $info['count ']. '">' . htmlspecialchars(stripslashes($tag)) . '</a>'; } $cloud_html = join("\n", $cloud_tags) . "\n"; return $cloud_html; }; ?> <h3>Sample Tag Cloud results</h3> <div id="wrapper" <!-- BEGIN Tag Cloud --> <?php print get_tag_cloud(); ?> <!-- END Tag Cloud --> </div>
  7. Were getting there! I now have this error: Warning: Invalid argument supplied for foreach() in /home/alns/public_html/contactfrm/tag.php on line 28
  8. I think were finally getting there but ur going to hate me because i forgot to include this bot of code in the quote <h3>Sample Tag Cloud results</h3> <div id="wrapper" <!-- BEGIN Tag Cloud --> <?php print get_tag_cloud(); ?> <!-- END Tag Cloud --> </div> which does include get_tag_cloud(); This is what displays all the tags obviously. How do i display the tags with ur code without that function?
  9. Yer this is the whole script i posted
  10. I already have the link id saved in the database, that is what im trying to fetch. But it doesnt work inside the $cloud_tags[] although it does work if i try and echo it just after the sql query. Therefore something is preventing it from working inside the $cloud_tags[] or before but i dont know what. How would i put the link into the array and would that make it work?
  11. But im not trying to sort anything im trying to get it to register the $link variable inside $cloud_tags = array()
  12. Just create how you want the email to look with tables and logos etc in html, then echo it out inside the email sript.
  13. I cant for the life of me how to register the row link from a table as a variable in my script! This sounds really stupid but i can register it obviously be doing $link = $row['link'] but this will only work if i put it just under the sql query. but if i try and echo it where i want it which is in the clouds tag array as a variable being passed through the url it wont register!! Here is my code <?php function get_tag_data() { include "db.php"; $result = mysql_query("SELECT tag, link, count FROM tags"); while($row = mysql_fetch_array($result)) { $arr[$row['tag']] = $row['count']; $link = $row['link']; // // this is where i can echo links echo =$link // // } ksort($arr); return $arr; } function get_tag_cloud() { // Default font sizes $min_font_size = 12; $max_font_size = 30; // Pull in tag data $tags = get_tag_data(); $minimum_count = min(array_values($tags)); $maximum_count = max(array_values($tags)); $spread = $maximum_count - $minimum_count; if($spread == 0) { $spread = 1; } $cloud_html = ''; $cloud_tags = array(); // create an array to hold tag code foreach ($tags as $tag => $count) { $size = $min_font_size + ($count - $minimum_count) * ($max_font_size - $min_font_size) / $spread; $cloud_tags[] = '<a style="font-size: '. floor($size) . 'px' // this is where it wont register! . '" class="tag_cloud" href="tagprocess.php?tag=' . $link . '" title="\'' . $tag . '\' returned a count of ' . $count . '">' . htmlspecialchars(stripslashes($tag)) . '</a>'; } $cloud_html = join("\n", $cloud_tags) . "\n"; return $cloud_html; }; ?> <h3>Sample Tag Cloud results</h3> <div id="wrapper" <!-- BEGIN Tag Cloud --> <?php print get_tag_cloud(); ?> <!-- END Tag Cloud --> </div> I know there must be a simple solution i just dont know how to solve it! Ive spent hours playing around with this. Cheers
  14. Ok i figured out how to increment the count by parsing the url to a php file like you explained. But in the url i need to parse the link variable but i cant get the link to variable to register from $link = $row['link'] inside the cloud tag array. If i try and echo it before ksort() then it works no problem but i need it inside the cloud tag array! here is my code, i just to sort this and its done! <?php function get_tag_data() { include "db.php"; $result = mysql_query("SELECT tag, link, count FROM tags"); while($row = mysql_fetch_array($result)) { $arr[$row['tag']] = $row['count']; $link = $row['link']; // // this is where i can echo links echo =$link // // } ksort($arr); return $arr; } function get_tag_cloud() { // Default font sizes $min_font_size = 12; $max_font_size = 30; // Pull in tag data $tags = get_tag_data(); $minimum_count = min(array_values($tags)); $maximum_count = max(array_values($tags)); $spread = $maximum_count - $minimum_count; if($spread == 0) { $spread = 1; } $cloud_html = ''; $cloud_tags = array(); // create an array to hold tag code foreach ($tags as $tag => $count) { $size = $min_font_size + ($count - $minimum_count) * ($max_font_size - $min_font_size) / $spread; $cloud_tags[] = '<a style="font-size: '. floor($size) . 'px' . '" class="tag_cloud" href="tagprocess.php?tag=' . $link . '" title="\'' . $tag . '\' returned a count of ' . $count . '">' . htmlspecialchars(stripslashes($tag)) . '</a>'; } $cloud_html = join("\n", $cloud_tags) . "\n"; return $cloud_html; }; ?> <h3>Sample Tag Cloud results</h3> <div id="wrapper" <!-- BEGIN Tag Cloud --> <?php print get_tag_cloud(); ?> <!-- END Tag Cloud --> </div> Please help!
  15. Ok ive got that sorted there is only one entry per tag and the count is incremented. Now how do i get the link variable to work and increment of +1 in that tags row everytime a tagis clicked?
  16. Im not sure why its set like that. This isnt my own code im just trying to modify it. The link isnt set thats part of what im asking on how to set it.
  17. Can someone please help me? Im trying to modify this code to include a url defined as $link into the array but im unsure of how to do it. Also this code is supposed to add 1 to a count coulmn in the database everytime a link is clicked but it doesnt seem to do this either. Could someone take a look and help me out? Thanks <?php function get_tag_data() { include "db.php"; $result = mysql_query("SELECT * FROM tags GROUP BY tag ORDER BY count DESC"); while($row = mysql_fetch_array($result)) { $arr[$row['tag']] = $row['count']; } ksort($arr); return $arr; } function get_tag_cloud() { // Default font sizes $min_font_size = 12; $max_font_size = 30; // Pull in tag data $tags = get_tag_data(); $minimum_count = min(array_values($tags)); $maximum_count = max(array_values($tags)); $spread = $maximum_count - $minimum_count; if($spread == 0) { $spread = 1; } $cloud_html = ''; $cloud_tags = array(); // create an array to hold tag code foreach ($tags as $tag => $count) { $size = $min_font_size + ($count - $minimum_count) * ($max_font_size - $min_font_size) / $spread; $cloud_tags[] = '<a style="font-size: '. floor($size) . 'px' . '" class="tag_cloud" href="' . $link . '" title="\'' . $tag . '\' returned a count of ' . $count . '">' . htmlspecialchars(stripslashes($tag)) . '</a>'; } $cloud_html = join("\n", $cloud_tags) . "\n"; return $cloud_html; }; ?> <h3>Sample Tag Cloud results</h3> <div id="wrapper" <!-- BEGIN Tag Cloud --> <?php print get_tag_cloud(); ?> <!-- END Tag Cloud --> </div>
  18. In my case its just showing all the records in the table including the ones inside and out the dates ive specified. My field isn't setup as a date field. Its setup as a varchar. Would that affect it do you think?
  19. Can someone please correct me where im going wrong here please? This is my code for trying to pull results that have a event date between two dates: <? include "db.php"; $act_type = 'All'; $area = 'Portsmouth'; $start = '01/01/2008'; $end = '30/05/2008'; $query = mysql_query("SELECT * FROM events WHERE date BETWEEN '$start' AND '$end'"); while ($data = mysql_fetch_array($query)) { ?> <table width="100%" border="0" cellpadding="2" cellspacing="2"> <tr> <td width="33%" bgcolor="#efefef"><?=$data["event"]?></td> <td width="47%" bgcolor="#efefef"><?=$data["date"]?></td> </tr> </table> <? } ?> For some reason it returns all records in the table rather than just the ones between the two dates. Thanks
  20. Hi all ive created a script that inserts post codes from a database into a geocoder that then pinpoints the locations on the google maps api. Trouble is that it can be really slow. As i guess it has to process each postcode seperatly from another URL. What i want to know is there any way for me to speed this process up as at the moment for about 10 records to be processed it takes around 13secs which will probably put any user off instantly! Here is my code: <script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAVB6_Pid5otsy8EjejpFSmBR3B9hOBASpmCh0hnUHdY3zy_OoFxQY7sAWvr8MPMRYjIZWvTGByQJU3g" type="text/javascript"></script> <script type="text/javascript"> //<![CDATA[ function load() { if (GBrowserIsCompatible()) { function createMarker(point,html) { var marker = new GMarker(point); GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(html); }); return marker; } var map = new GMap2(document.getElementById("map")); map.setCenter(new GLatLng(50.8040, -1.0700), 13); map.addControl(new GLargeMapControl()); $i=0; while ($i < $num) { $event=mysql_result($result,$i,"event"); $postcode=mysql_result($result,$i,"postcode"); $email=mysql_result($result,$i,"email"); $phone=mysql_result($result,$i,"phone"); ?> <? $url = "http://geo.localsearchmaps.com/?zip="; $url .= urlencode($postcode); $url .= "&country=UK&use=google2&format=txt"; if ($grab_coordinates = file_get_contents($url)) { $coord_pair = explode(", ", $grab_coordinates); if (sizeof($coord_pair) == 2) { $latitude = $coord_pair[0]; $longitude = $coord_pair[1]; }; }; ?> <? echo "var point = new GLatLng($latitude,$longitude); var marker = createMarker(point,'<div style=\"width:240px; padding:4px; font-family:Lucida Sans, Arial;\">$event</br>$postcode</br>Email: $email</br>Telephone: $phone</div>') map.addOverlay(marker);" ?> <? $i++; } mysql_close(); ?> thanks } } //]]> </script>
  21. No thats doesnt work ive tried that
  22. Hi all im currently working on a application that uses google maps. Im trying to customize the info windows using CSS but for some reason i cannot get the font to change! Prettt much every other CSS rule apart from that one! This is my code: <? echo "var point = new GLatLng($latitude,$longitude); var marker = createMarker(point,'<div style=\"width:240px; padding:4px; background-color:#FFCC66; font:Arial, Helvetica, sans-serif;\">$event</br>$postcode</br>Email: $email</br>Telephone: $phone</div>') map.addOverlay(marker);" ?> Someone please tell me where im going wrong! Thanks
  23. Hi all. Im currently trying to build an application that pinpoints an address from a database onto the google maps api. Ive found a suitable geoloader that gives me a longitude and latitude suitable for google maps but i want to know how to parse it into my webpage. This is how i imagine it will work. I will click on an address for example, 10 Oxford Street London. Which will then parse the variables onto this URL: http://geo.localsearchmaps.com/?street=10+Oxford+Street&city=London&country=UK Which then outputs some text onto the page which is the code that needs to be injected into the google maps api code on my webpage. All im wanting to know is how to get that bit of code that appears the webpage and inject it into mine??? I hope this makes sense thanks!
  24. Ok thanks for your help. Im on a shared host so i will look into it.
  25. Well i can run php scripts fine its just parsing php in html thats the problem.
×
×
  • 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.