Jump to content

Heath

Members
  • Posts

    28
  • Joined

  • Last visited

    Never

Everything posted by Heath

  1. I am working on converting my rss feed to suit the truveo video sitemap needs but I am getting a error. For those who would like to help, or develop their own, the directions can be found here http://developer.truveo.com/DirectorDocumentation.php This is their sample rss document.... A sample Media RSS file is shown below. Required tags are in red. <?xml version="1.0" encoding="utf-8"?> <rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/" xmlns:av="http://www.searchvideo.com/schemas/av/1.0"> <channel> <title>Metacafe</title> <link>http://www.metacafe.com/rss/today_videos/mrss.xml</link> <description>Today's Videos, Movies and Funny Clips by Metacafe</description> <item> <author>mooncat56</author> <title>Making Of 300-The Movie</media:title> <link>http://www.metacafe.com/watch/504132/making_of_300_the_movie/</link> <description>Actors work and train as ONE in the fight scenes. Six weeks of training to learn the moves devised for this movie. </description> <guid isPermaLink="true">http://www.metacafe.com/watch/504132/making_of_300_the_movie/</guid> <pubDate>Tue, 17 Apr 2007 02:50:07 +0000</pubDate> <media:description>Actors work and train as ONE in the fight scenes. Six weeks of training to learn the moves devised for this movie.</media:description> <media:content url="http://www.metacafe.com/fplayer/504132/making_of_300_the_movie.swf" type="application/x-shockwave-flash" medium="video" height="345" width="400" duration="243" /> <media:player url="http://www.metacafe.com/watch/504132/making_of_300_the_movie/" /> <media:thumbnail url="http://images.metacafe.com/thumb/504132/3445872/4/rss_feed5/0/ making_of_300_the_movie.jpg" width="120" height="90" /> <media:title>Making Of 300-The Movie</media:title> <media:keywords>spartans,300,fight</media:keywords> <media:credit>mooncat56</media:credit> <media:rating scheme="urn:simple">nonadult</media:rating> <media:category>Entertainment</media:category> </item> </channel> </rss> Here is the line that is giving me a bit of a issue. <media:player url="http://www.metacafe.com/watch/504132/making_of_300_the_movie/" /> Here is how I have it in my php... <media:player url=\"http://www.metacafe.com/watch/504132/making_of_300_the_movie/"\ /> any thing I am doing wrong?
  2. Awesome, that worked! How ever now there is no space between things that had a br.... any way to add a space or something? Here is my what I am editing.. while ($row = $DB->fetch_row($query)) { $id = $row['id']; $name = str_replace("´", "", $row['name']); $name = preg_replace('/&(?!(#[0-9]+|[a-z]+);)/si', '&', $name); $description = str_replace("<br />", "", $row['description']); $description = preg_replace('/&(?!(#[0-9]+|[a-z]+);)/si', '&', $description); $pic = $row['pic']; $content .= "
  3. DarkWater can u wrap that in the code thing so I can see it all please? Thank you very much!
  4. <url> <loc>http://mydomain.com/index.php?ind=media&op=file_view&iden=281656</loc> <video:video> <video:title>How to Make Fire Balls&#33; Really Cool&#33;</video:title> <video:description>How to make fireballs that you can hold in your hands. Be careful though, it&#39;s still fire and can still burn you. Found this vid and thought it was cool.<br /></video:description> <video:thumbnail_loc>http://mydomain.com/mkportal/modules/media/pics/mk_281656.jpg</video:thumbnail_loc> </video:video> </url> That is one of the video sitemap outputs that has a <br / > in it that continues to cause problems. There are over 100+ that also have this problem. So its imperative I get it worked out using php or else it is a lot of manual labor.
  5. I have a video sitemap that is including br's in my description and giving me error messages on google. Is there a way to use one of these lines to remove the </ br> Here are the 2 lines of code i have been playing with to remove them. This is all I have so far. $description = str_replace("´", "", $row['description']); $description = preg_replace('/&(?!(#[0-9]+|[a-z]+);)/si', '&', $description);
  6. This has been puzzling me for months now. Every time I try to edit it to match what google says here... http://www.google.com/support/webmasters/bin/answer.py?answer=80472&topic=10079 Here is what they say the format they want is. <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:video="http://www.google.com/schemas/sitemap-video/1.0"> <url> <loc>http://www.site.com/videos/some_video_landing_page.html</loc> <video:video> <video:content_loc>http://www.site.com/video123.flv</video:content_loc> <video:player_loc allow_embed="yes">http://www.site.com/videoplayer.swf?video=123</video:player_loc> <video:title>My funny video</video:title> <video:thumbnail_loc>http://www.site.com/thumbs/123.jpg</video:thumbnail_loc> </video:video> </url> <url> <loc>http://www.site.com/videos/some_other_video_landing_page.html</loc> <video:video> <video:content_loc>http://www.site.com/videos/video1.mpg</video:content_loc> <video:description>A really awesome video</video:description> </video:video> </url> </urlset> Which looks pretty simple to me. But converting the RSS/PHP i have now to match that is were I keep running into problems. Here is my current Php that creates my rss. case 'rss': $this->rss(); function rss() { global $mkportals, $DB, $mklib; $content = "<?xml version='1.0' encoding='iso-8859-1'?>\n <rss version='2.0'> <channel> <title>$mklib->sitename</title> <link>$mklib->siteurl</link> <description>MkMedia Generated</description> <generator>MkMedia</generator> <language>Multi-Lang</language> <copyright>MkMedia 2004 - ".date("Y")."</copyright>"; $query = $DB->query("SELECT id, name, description, data, author FROM mkp_media WHERE validate = '1' AND visible = '1' ORDER by `data` DESC LIMIT 0,10"); if (!$DB->get_num_rows($query)) { $content .= " <item> <title>Sorry There Are Currently No Feeds</title> <link></link> <pubDate></pubDate> <author></author> <description></description> </item> </channel> </rss>"; $rsslength = strlen($content); header("Content-Type: text/xml"); header("Content-Length: ".$rsslength); header("Cache-Control: no-cache"); echo $content; exit; } while ($row = $DB->fetch_row($query)) { $id = $row['id']; $date = $mklib->create_date($row['data']); $name = str_replace("´", "", $row['name']); $name = preg_replace('/&(?!(#[0-9]+|[a-z]+);)/si', '&', $name); $description = str_replace("´", "", $row['description']); $description = preg_replace('/&(?!(#[0-9]+|[a-z]+);)/si', '&', $description); $author = $row['author']; $content .= " <item> <title>{$name}</title> <link>$mklib->siteurl/index.php?ind=media&op=file_view&iden={$id}</link> <pubDate>{$date}</pubDate> <author>{$author}</author> <description>{$description}</description> </item>"; } $content .= " </channel> </rss>"; $rsslength = strlen($content); header("Content-Type: text/xml"); header("Content-Length: ".$rsslength); header("Cache-Control: no-cache"); echo $content; exit; } My question is what exactly am I supposed to do to replicate the requirements for googles video sitemap with some thing written for RSS Output? I am new to the whole php thing still, very little time to work on it, but from what I do know, every thing i've tried seems to be along the lines of what I was suggested to do with no luck. So if you could provide any help I would greatly appreciate it. Thank you.
  7. I have been working on this one for a few weeks now, before that on and off and I have come to the conclusion I just don't understand php enough to get how to change this to get it working properly. First - I was trying to add the ability to give each category in my media section its own RSS feed. I am not really sure if I am providing enough of the code, if I am not, please just let me know what else I need to include. (the code will be posted below). Currently the code allows for me to see the newest over all. I was trying to make it so it would be like media=rss=sectionID . Right now its just media=rss. This one has been boggling my mind for some time now. Second, I wanted to also convert the code below to produce a proper google video sitemap. If this is possible could some one PLEASE explain it, I have been working on getting this one working for weeks now with no luck. It seems really simple to do, but apparently I just can't figure it out. So if any one could please explain how to do it I would be highly great full. I really do not know much so I would really appreciate any one willing to help me with this as well as give me some little tips if possible in order to help me better understand how it works. Here is the code I am trying to play with that creates my current RSS feed for my video section. function rss() { global $mkportals, $DB, $mklib; $content = "<?xml version='1.0' encoding='iso-8859-1'?>\n <rss version='2.0'> <channel> <title>$mklib->sitename</title> <link>$mklib->siteurl</link> <description>MkMedia Generated</description> <generator>MkMedia</generator> <language>Multi-Lang</language> <copyright>MkMedia 2004 - ".date("Y")."</copyright>"; $query = $DB->query("SELECT id, name, description, data, author FROM mkp_media WHERE validate = '1' AND visible = '1' ORDER by `data` DESC LIMIT 0,10"); if (!$DB->get_num_rows($query)) { $content .= " <item> <title>Sorry There Are Currently No Feeds</title> <link></link> <pubDate></pubDate> <author></author> <description></description> </item> </channel> </rss>"; $rsslength = strlen($content); header("Content-Type: text/xml"); header("Content-Length: ".$rsslength); header("Cache-Control: no-cache"); echo $content; exit; } while ($row = $DB->fetch_row($query)) { $id = $row['id']; $date = $mklib->create_date($row['data']); $name = str_replace("´", "", $row['name']); $name = preg_replace('/&(?!(#[0-9]+|[a-z]+);)/si', '&', $name); $description = str_replace("´", "", $row['description']); $description = preg_replace('/&(?!(#[0-9]+|[a-z]+);)/si', '&', $description); $author = $row['author']; $content .= " <item> <title>{$name}</title> <link>$mklib->siteurl/index.php?ind=media&op=file_view&iden={$id}</link> <pubDate>{$date}</pubDate> <author>{$author}</author> <description>{$description}</description> </item>"; } $content .= " </channel> </rss>"; $rsslength = strlen($content); header("Content-Type: text/xml"); header("Content-Length: ".$rsslength); header("Cache-Control: no-cache"); echo $content; exit; } For the sitemap my goal is to replicate this. http://www.google.com/support/webmasters/bin/answer.py?answer=80472&topic=10079 Again, any help would be highly appreciated, both of these issues are really annoying for me to accomplish.
  8. popuplace.com sorry i didn't want to seem like a spammer or some thing by putting a link. its under the "New Pictures" section on the front page.
  9. Here is every thing I have. Currently. When it outputs. What should be the 2nd table in the 2nd part of this still pulls every thing from query2 and i can't figure out why. <?php $limit = 10; $cut = 1000; $content = ""; $query = $DB->query("SELECT id, titolo, file FROM mkp_gallery where validate = '1' ORDER BY `id` DESC LIMIT $limit"); while ($row = $DB->fetch_row($query)) { $idu = $row['id']; $umes = ""; $message = substr($row['description'], 0, $cut); $message = str_replace("<br>", " ", $message); $message = explode(" ", $message); foreach ($message as $value) { if (strlen($value) > 20) { $value = substr($value, 0, 22); } $umes .= $value." "; } $content.= " <td><tr> <td class=\"frontpics\"><a href=\"$this->siteurl/index.php?ind=gallery&op=foto_show&ida=$idu\" class=\"uno\"><img src=/images/front-page-bullet.jpg> {$row['titolo']}</a> </td> </tr>"; } if($idu == NULL) { $content = " <tr> <td align=\"center\"> There are no Files </td> </tr> "; } if(!$mkportals->member['g_access_cp'] && !$this->member['g_access_gallery']) { $content = " <tr> <td align=\"center\"> {$this->lang['gallery_noallow']} </td> </tr><td> "; } unset($row); unset($umes); unset($message); unset($idu); //2nd part $query = $DB->query("SELECT id, titolo, file FROM mkp_gallery where validate = '1' ORDER BY `id` DESC LIMIT $limit"); $query2 = $DB->query("SELECT id, evento FROM mkp_gallery_events ORDER BY `id` DESC LIMIT $limit; "); while ($row2 = $DB->fetch_row($query2)) { $idu = $row2['id']; $idb = $row['id']; $umes = ""; $message = substr($row['description'], 0, $cut); $message = str_replace("<br>", " ", $message); $message = explode(" ", $message); foreach ($message as $value) { if (strlen($value) > 20) { $value = substr($value, 0, 22); } $umes .= $value." "; } $content.= " <td> <tr> <td class=\"frontpics\"><a href=\"$this->siteurl/index.php?ind=gallery&op=section_view&idev=$idu\" class=\"uno\"><img src=/images/front-page-bullet.jpg> {$row2['evento']}</a></td> <td class=\"frontpics\"><a href=\"$this->siteurl/index.php?ind=gallery&op=foto_show&ida=$idb\" class=\"uno\"><img src=/images/front-page-bullet.jpg> {$row['titolo']}</a> </td> </tr>"; } if($idu == NULL) { $content = " <tr> <td align=\"center\"> There are no Files </td> </tr> "; } if(!$mkportals->member['g_access_cp'] && !$this->member['g_access_gallery']) { $content = " <tr> <td align=\"center\"> {$this->lang['gallery_noallow']} </td> </tr><td> "; } unset($row); unset($umes); unset($message); unset($idu); ?> I am trying to get the content to show up side by side, opposed to one long list. So it would look like this (Block One ) (Block 1 2nd Query ) (Block Two ) (Block 2 2nd Query ) Right now its just straight down 10, then the 2nd Queries 10. With empty fields with just the image and empty tables with no title like it should be. Thank you. I appreciate the help.
  10. I have been trying to merge 2 seperate codes I made to show up side by side. In order to do this though, I need to be able to run multiple mysql queries... Here are the 2 queries. Query 1- $query = $DB->query("SELECT id, titolo, file FROM mkp_gallery where validate = '1' ORDER BY `id` DESC LIMIT $limit"); Query 2- $query2 = $DB->query("SELECT id, evento FROM mkp_gallery_events ORDER BY `id` DESC LIMIT $limit; "); Any clue how to accomplish this?
  11. I am looking to make or find some sort of referral script that will save the hits and domains that send my sites hits. I would like it to automatically store and display the top sites of the day and week and be able to embed the script easily in my current cms. Any help would be greatly appreciated. I've been looking for 2 days and can't seem to find any thing with a demo.
  12. The MySpace one? What about the Yahoo one? Do you have any links to examples or tutorials??
  13. go to myspace.com, see the top search, see beside the search field you have a drop down with more choices. Thats what I would want to accomplish if I had to go with the MySpace style search. But my goal was to get the kind like Yahoo.com uses. Go there, at the top. Click Images, see how the search button changes to "Image Search". Then click Video, and the button will again change to "Video Search" Thats my goal. But either will do.
  14. I have been looking for a example all day for how to do either a drop down choice search like myspace, or the kind that the yahoo, live search engines use where you can click a section and it changes, with the button to say. "Video Search" on the button, and would search that if some one was to search for something.... Any links or codes to help me better understand how to do this?
  15. I have recently redesigned a clip dump script and I am trying to add the ability for people to submit tags for their items. Here is what I have done so far. I have added this to my websites functions file. function tag_info() { $result = mysql_query("SELECT * FROM tags GROUP BY tagName ORDER BY Rand() DESC"); while($row = mysql_fetch_array($result)) { $arr[$row['tagName']] = $row['count']; } //ksort($arr); return $arr; } function tag_cloud() { $min_size = 20; $max_size = 60; $tags = tag_info(); $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(); $step = ($max_size - $min_size)/($spread); foreach ($tags as $tag => $count) { $size = $min_size + ($count - $minimum_count) * $step; // $size = ($max_size + $min_size)/$spread; $cloud_tags[] = '<a style="font-size: '. floor($size) . 'px' . '" class="tag_cloud" href="http://localhost/content/tagcloud.php?s=' . $tag . '" title="\'' . $tag . '\' returned a count of ' . $count . '">' . htmlspecialchars(stripslashes($tag)) . '</a>'; } $cloud_html = join("\n", $cloud_tags) . "\n"; return $cloud_html; } I then added this to my sites CSS .tag_cloud {padding: 3px; text-decoration: none; font-family: verdana; } .tag_cloud:link { color: #FF66CC; } .tag_cloud:visited { color: #9900FF; } .tag_cloud:hover { color: #FF66CC; background: #000000; } .tag_cloud:active { color: #6699FF; background: #000000; } div.wrapper{ position:absolute; height:200px; width:400px; } After that I added this code to my sites template <div id="wrapper" class="wrapper"> <?php print tag_cloud(); ?> </div> Last, I ran this MySQL code in phpmyadmin CREATE TABLE tags (TagID INT AUTO_INCREMENT NOT NULL PRIMARY KEY, tagName VARCHAR(50) NOT NULL, UNIQUE(tagName), TagActive INT NOT NULL DEFAULT 1); Currently I think the table is empty so there is nothing showing, but I am not getting any errors, so I am assuming its working properly. What I am now trying to do is add the ability for some one to add their own tags like so php, freaks, web design, doesnt matter and have them added to the database as single search terms any time the , comes up it knows that starts a new tag? Can some one help me with this please? I can't find any articles any where including the submission part.
  16. I am trying to make a link dump script, right now i have most of it complete but I want to add a few more features I can't figure out. Right now when you click the link, it takes you directly to that site. I want it to open in a new frame still at my site. With the title of the page and the link reading as the titles. For instance. If some one submits some thing named Php Freak. I want the title to show "Php Freak > Category Submitted to > Site Title" and I want the link to be http://www.mydomain/category/Php_Freak or /Php_Freak/ Here is what I have so far. <?php //////////////////////////////////////////////////////////////////////////// // Yodyo Link Dump v.1 //////////////////////////////////////////////////////////////////////////// ob_start(); include('config.php'); include('header.php'); $ax=$_GET["ax"]; $list_type=$_GET["l"]; //////////////// // List Function //////////////// if ($ax=="list") { if($list_type=="clicks") { echo "<p class=\"bodylgbold\">$popular Most Popular Links</p>"; echo "<p class=\"bodysm\"> > <a href=\"$PHP_SELF\">Home</a> > Popular Links</p>"; $sql_rqst="SELECT * FROM links WHERE approved='yes' ORDER BY clicks DESC LIMIT 0,".$popular; } else if($list_type=="date_added") { echo "<p class=\"bodylgbold\">$new Newest Links</p>"; echo "<p class=\"bodysm\"> > <a href=\"$PHP_SELF\">Home</a> > Newest Links</p>"; $sql_rqst="SELECT * FROM links WHERE approved='yes' ORDER BY date_added,id ASC LIMIT 0,".$new; } else { $topic_result = MySQLQuery("SELECT * FROM links_cat WHERE id=$cat_id", $QueryError_Email,$QueryError_Browser); while($topic_row = mysql_fetch_array($topic_result)) { $id=$topic_row["id"]; $formcat_id=$topic_row["id"]; $sub_cat=$topic_row["sub_cat"]; $name=$topic_row["name"]; $dsc=$topic_row["dsc"]; } if($sub_cat != 0) { $topic2_result = MySQLQuery("SELECT id,sub_cat,name FROM links_cat WHERE id=$sub_cat", $QueryError_Email,$QueryError_Browser); while($topic2_row = mysql_fetch_array($topic2_result)) { $id2=$topic2_row["id"]; $sub_cat2=$topic2_row["sub_cat"]; $name2=$topic2_row["name"]; } $trail="<a href=\"$PHP_SELF?ax=list&sub=$id2&cat_id=$id2\">$name2</a> > $name"; } else { $trail=$name; } echo "<p class=\"bodylgbold\">$name</p>"; echo "<p class=\"bodysm\"> > <a href=\"$PHP_SELF\">Home</a> > $trail</p>"; echo "<p class=\"bodymd\">$dsc</p>"; if(!isset($start)){$start = 0;} $sql_rqst="SELECT * FROM links WHERE cat_id=".$_GET["cat_id"]." AND approved='yes' ORDER BY ".$list_by." ".$list_order." LIMIT ".$start.",".$category; $page_result = MySQLQuery("SELECT * FROM links WHERE cat_id=$cat_id",$QueryError_Email,$QueryError_Browser); $previous_page=$start - $category; $next_page=$start + $category; $numrows=mysql_num_rows($page_result); if(($start > 0) || ($numrows > ($start + $category))){echo "<p class=\"bodysm\">";} if($start > 0){echo "[ <a href=\"$PHP_SELF?ax=list&l=list_by&cat_id=$cat_id&start=$previous_page\">< < Previous</a> ]\n";} if($numrows > ($start + $category)){echo "[ <a href=\"$PHP_SELF?ax=list&l=list_by&cat_id=$cat_id&start=$next_page\">Next > ></a> ]\n";} if(($start > 0) || ($numrows > ($start + $category))){echo "</p>";} } $result = MySQLQuery($sql_rqst,$QueryError_Email,$QueryError_Browser); while($row = mysql_fetch_array($result)) { $id=$row["id"]; $name=$row["name"]; $clicks=$row["clicks"]; $approved=$row["approved"]; $url=$row["url"]; $dsc=$row["dsc"]; $date_added=$row["date_added"]; $year = substr($date_added, 0, 4); $month = substr($date_added, 5, 2); $day = substr($date_added, 8, 2); $date_added=date($display_format,mktime("00","00","00",$month,$day,$year)); $image=$row["image"]; $rating=$row["rating"]; $rates=$row["rates"]; if($image_enabled=="yes" && $image) { $image="<img src=\"$image\" align=\"right\">"; } else { $image=""; } if($rates=="" || $rates=="0") { $rate_stat="<i>Not Yet Rated</i>"; } else { $rating=$rating / $rates; $rating=round($rating,2); $rate_stat=$rating." out of 10 (".$rates." Ratings)"; } if($clicks==""){$clicks="0";} ?> <script type="text/javascript"> <!-- function validate_rate<?php echo $id; ?>() { if(document.getElementById('form<?php echo $id; ?>').rating.selectedIndex == 0){alert("Please select your rating for <?php echo $name ?> from 1-10.");return false;} } //--> </script> <p class="bodymd"><?php echo $image; ?><a href="<?php echo $PHP_SELF ?>?ax=out&id=<?php echo $id ?>"><?php echo $name ?></a> <br /><span class="bodysm">[ Added: <?php echo $date_added ?> | Total Clicks: <?php echo $clicks ?> | Rating: <?php echo $rate_stat ?> | <a href="#" onclick="blocking('<?php echo $id ?>');return false;">Rate This Website</a> | <a href="<?php echo $PHP_SELF ?>?ax=deadlink&id=<?php echo $id ?>">Notify of Dead Link</a> ]</span> <br /><?php echo $dsc ?> <br /><div id="<?php echo $id ?>"><form action="<?php echo $PHP_SELF ?>?ax=addrate&id=<?php echo $id ?>&cat_id=<?php echo $formcat_id; ?>&l=<?php echo $list_type; ?>" method="post" id="form<?php echo $id; ?>" onsubmit="return validate_rate<?php echo $id; ?>();"><span class="bodysm">Rate This Website</span> <select name="rating" class="bodysm"><option>- choose --</option><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option><option value="9">9</option><option value="10">10</option></select> <input type="submit" name="submit" value="Rate <?php echo $name ?>" class="bodysm" /></div></form> </p> <script type="text/javascript"> <!-- document.getElementById('<?php echo $id ?>').style.display='none'; //--> </script> <?php } if($_GET["l"]!="date_added" && $_GET["l"]!="clicks") { if(($start > 0) || ($numrows > ($start + $category))){echo "<p class=\"bodysm\">";} if($start > 0){echo "[ <a href=\"$PHP_SELF?ax=list&l=list_by&cat_id=$cat_id&start=$previous_page\">< < Previous</a> ]\n";} if($numrows > ($start + $category)){echo "[ <a href=\"$PHP_SELF?ax=list&l=list_by&cat_id=$cat_id&start=$next_page\">Next > ></a> ]\n";} if(($start > 0) || ($numrows > ($start + $category))){echo "</p>";} } } else if($ax=="out") { $result = MySQLQuery("SELECT id,url,clicks FROM links WHERE id=".$_GET["id"],$QueryError_Email,$QueryError_Browser); while($row = mysql_fetch_array($result)) { $id=$row["id"]; $url=$row["url"]; $clicks=$row["clicks"]; $clicks=$clicks+1; $up_clicks = MySQLQuery("UPDATE links SET clicks='$clicks' WHERE id='$id'",$QueryError_Email,$QueryError_Browser); ob_end_clean(); header("Location: ".$url); } } else if($ax=="deadlink") { $result = MySQLQuery("SELECT id,name,url FROM links WHERE id=".$_GET["id"],$QueryError_Email,$QueryError_Browser); while($row = mysql_fetch_array($result)) { $id=$row["id"]; $url=$row["url"]; $name=$row["name"]; $clicks=$clicks+1; $message="$name\n$url\nis being reported as a dead link in the links directory at $site_title"; mail("$admin_mail","Deal Link Report from $site_title","$message","From: $admin_mail"); echo "<p class=\"bodylgbold\">Thank You</p>"; echo "<p class=\"bodysm\"> > <a href=\"$PHP_SELF\">Home</a> > Report Dead Link</p>"; echo "<p class=\"bodymd\">You have reported $name linked to $url as being a deal link in our directory.</p>"; echo "<p class=\"bodymd\">This message has been sent to the web site administrator, thank you for your help.</p>"; } } else if($ax=="addrate") { $id=$_GET["id"]; $cat_id=$_GET["cat_id"]; $new_rating=$_POST["rating"]; $result = MySQLQuery("SELECT id,rating,rates FROM links WHERE id=$id;",$QueryError_Email,$QueryError_Browser); while($row = mysql_fetch_array($result)) { $rating=$row["rating"]; $rating=$rating + $new_rating; $rates=$row["rates"]; $rates=$rates + 1; $up_clicks = MySQLQuery("UPDATE links SET rating='$rating',rates='$rates' WHERE id='$id'",$QueryError_Email,$QueryError_Browser); echo "<p class=\"bodylgbold\">Thanks for your input</p>\n"; echo "<p class=\"bodysm\"> > <a href=\"$PHP_SELF\">Home</a> > Rating</p>"; echo "<p class=\"bodymd\">Your rating has been added, thank you.</p>\n"; } if($list_type=="") { $sub_result = MySQLQuery("SELECT id,sub_cat FROM links_cat WHERE id=".$cat_id."",$QueryError_Email,$QueryError_Browser); while($sub_row = mysql_fetch_array($sub_result)) { $list_type=$_GET["l"]; if($list_type=="") { $id=$sub_row["id"]; $subcat=$sub_row["sub_cat"]; if($subcat==0){$subcat=$id;} echo "<p class=\"bodymd\">To return to the page you were at, <a href=\"".$_SERVER["PHP_SELF"]."?ax=list&sub=". $subcat."&cat_id=".$id."\">click here</a>.</p>\n"; } } } else { echo "<p class=\"bodymd\">To return to the page you were at, <a href=\"".$_SERVER["PHP_SELF"]."?ax=list&l=".$_GET["l"]."\">click here</a>.</p>\n"; } } ////////////////// // Search Function ////////////////// else if ($ax=="search") { echo "<p class=\"bodylgbold\">Search Results</p>"; echo "<p class=\"bodysm\"> > <a href=\"$PHP_SELF\">Home</a> > Search Results</p>"; if(!isset($start)) { $start = 0; $search_for=$_POST["search_for"]; } else { $search_for=$_GET["search_for"]; } $result = MySQLQuery("SELECT * FROM links WHERE (name LIKE '%".$search_for."%' OR url LIKE '%".$search_for."%' OR dsc LIKE '%".$search_for."%') AND approved='yes' ORDER BY name ASC LIMIT $start,$search",$QueryError_Email,$QueryError_Browser); $page_result = MySQLQuery("SELECT * FROM links WHERE (name LIKE '%".$search_for."%' OR url LIKE '%".$search_for."%' OR dsc LIKE '%".$search_for."%') AND approved='yes' ORDER BY id DESC",$QueryError_Email,$QueryError_Browser); $previous_page=$start - $search; $next_page=$start + $search; $numrows=mysql_num_rows($page_result); echo "<p class=\"bodymd\">Total of $numrows Records Returned</p>"; if(($start > 0) || ($numrows > ($start + $search))){echo "<p class=\"bodysm\">";} if($start > 0){echo "[ <a href=\"$PHP_SELF?ax=search&search_for=$search_for&start=$previous_page\">< < Previous</a> ]\n";} if($numrows > ($start + $search)){echo "[ <a href=\"$PHP_SELF?ax=search&search_for=$search_for&start=$next_page\">Next > ></a> ]\n";} if(($start > 0) || ($numrows > ($start + $search))){echo "</p>";} while($row = mysql_fetch_array($result)) { $id=$row["id"]; $name=$row["name"]; $clicks=$row["clicks"]; $approved=$row["approved"]; $url=$row["url"]; $dsc=$row["dsc"]; if ($approved=="yes") { if($clicks==""){$clicks="0";} echo "<p class=\"bodymd\"><a href=\"$PHP_SELF?ax=out&id=$id\">$name</a> <br /><span class=\"bodysm\">[ <a href=\"$PHP_SELF?ax=out&id=$id\">$url</a> | Total Clicks: $clicks | <a href=\"$PHP_SELF?ax=deadlink&id=$id\">Notify of Dead Link</a> ]</span> <br />$dsc</p>"; } } if(($start > 0) || ($numrows > ($start + $search))){echo "<p class=\"bodysm\">";} if($start > 0){echo "[ <a href=\"$PHP_SELF?ax=search&search_for=$search_for&start=$previous_page\">< < Previous</a> ]\n";} if($numrows > ($start + $search)){echo "[ <a href=\"$PHP_SELF?ax=search&search_for=$search_for&start=$next_page\">Next > ></a> ]\n";} if(($start > 0) || ($numrows > ($start + $search))){echo "</p>";} } /////////////////////////// // Add and Insert Functions /////////////////////////// else if($ax=="add") { $date_added=date($date_format); ?> <p class="bodylgbold">Add a Link</p> <p class="bodysm"> > <a href="<?php echo $PHP_SELF; ?>">Home</a> > Add a Link</p> <p class="bodymd">All Fields are required for link submission</p> <form action="<?php echo $PHP_SELF; ?>?ax=insert" method="post" id="form" onsubmit="return validate_add();"> <table border="0" width="100%" cellspacing="2" cellpadding="0"> <tr> <td class="bodymd"><span style="color:#FF0000;">*</span>Category:<br /> <select name="cat_id"> <option value="">Select a Category</option> <?php $result=MySQLQuery("select * from links_cat where id !=0 order by name",$QueryError_Email,$QueryError_Browser); while($row=mysql_fetch_array($result)) { $cat_id=$row["id"]; $cat_name=$row["name"]; echo "<option value=\"$cat_id\"> $cat_name</option>"; } ?> </select> </td> </tr> <tr><td class="bodymd">Website Name<span style="color:#FF0000;">*</span>:<br /><input type="text" name="name" size="60"/></td></tr> <tr><td class="bodymd">Website Description<span style="color:#FF0000;">*</span>:<br /><textarea name="dsc" rows="3" cols="40"></textarea></td></tr> <tr><td class="bodymd">URL<span style="color:#FF0000;">*</span>:<br /><input type="text" name="url" size="60"/></td></tr> <?php if($image_enabled=="yes"){ ?> <tr><td class="bodymd">Image URL:<br /><input type="text" name="image" size="60" value="<?php echo $image; ?>" maxlength="100"/></td></tr> <?php } ?> <tr><td class="bodymd"> Email:<br /><input type="text" name="email" size="50"/></td></tr> <tr><td class="bodymd"> Password:<br /><input type="password" name="password" size="10"/></td></tr> <tr><td class="bodymd"><span style="color:#FF0000;">*</span> - indicates required field</td></tr> <tr><td><input type="hidden" name="date_added" value="<?php echo $date_added; ?>"/><input type="submit" name="submit" value="Add Link"/></td></tr> </table> </form> <?php } else if($ax=="insert") { $cat_id=$_POST["cat_id"]; $name=$_POST["name"]; $dsc=$_POST["dsc"]; $url=$_POST["url"]; $email=$_POST["email"]; $password=$_POST["password"]; $date_added=$_POST["date_added"]; $image=$_POST["image"]; if($admin_approved=="no") { $approved="no"; } else { $approved="yes"; } $result=MySQLQuery("insert into links (cat_id,name,dsc,url,approved,email,password,date_added,image,rating,rates) values ('$cat_id','$name','$dsc','$url','$approved','$email','$password','$date_added','$image','0','0')",$QueryError_Email,$QueryError_Browser); if ($result) { mail("$admin_mail", "Link submitted to ".$site_title."", "The link ".$name." is waiting for approval at ".$site_title."", "From: ".$admin_mail.""); if ($email && $password) { mail($email, "Link submitted to ".$site_title."","Your link is waiting for approval at ".$site_title.".\nTo update you listing in the future, login with \n\nURL:".$url."\nEmail:".$email."\nPassword:".$password."\n\nThanks for your submission", "From: ".$GLOBALS["NoReply_Mail"]); } echo "<p class=\"bodylgbold\">The Link Was Added</p>"; echo "<p class=\"bodysm\"><a href=\"".$PHP_SELF."\">Home</a> > <a href=\"".$PHP_SELF."?ax=add\">Add a Link</a> > Link Added</p>"; if($admin_approved=="no") { echo "<p class=\"bodymd\">Your link request has been sent to the site administrator for approval.</p>"; echo "<p class=\"bodymd\">An email has also been sent to you regarding your login information should you choose to edit your listing in the future.</p>"; } else { echo "<p class=\"bodymd\">Your link has been added to the directory.</p>"; echo "<p class=\"bodymd\">An email has also been sent to you regarding your login information should you choose to edit your listing in the future.</p>"; } } else { echo "<p class=\"bodysm\"><a href=\"".$PHP_SELF."\">Home</a> > <a href=\"".$PHP_SELF."?ax=add\">Add a Link</a> > Error Adding Link</p> <p class=\"bodylgbold\">Error Adding Link</p>"; } } ////////////////////////////// // Login and Editing Functions ////////////////////////////// else if($ax=="login") { ?> <p class="bodylgbold">Edit Your Listing</p> <p class="bodysm"> > <a href="<?php echo $PHP_SELF; ?>">Home</a> > Edit Login</p> <form action="<?php echo $PHP_SELF; ?>?ax=editlogin" method="post" id="form" onsubmit="return validate_login();"> <table border="0" width="100%" cellspacing="2" cellpadding="0"> <tr><td class="bodymd">URL<span style="color:#FF0000;">*</span>:<br /><input type="text" name="url" size="60"/></td></tr> <tr><td class="bodymd">Email<span style="color:#FF0000;">*</span>:<br /><input type="text" name="email" size="60"/></td></tr> <tr><td class="bodymd">Password<span style="color:#FF0000;">*</span>:<br /><input type="password" name="password" size="60"/></td></tr> <tr><td class="bodymd"><span style="color:#FF0000;">*</span> - indicates required field</td></tr> <tr><td><input type="submit" name="submit" value="Login"/></td></tr> <tr><td class="bodymd"><a href="<?php echo $PHP_SELF; ?>?ax=remind">Forget your login info?</a></td></tr> </table> </form> <?php } else if($ax=="editlogin") { $result=MySQLQuery("select * from links where url='".$_POST["url"]."' and email='".$_POST["email"]."' and password='".$_POST["password"]."'",$QueryError_Email,$QueryError_Browser); if(mysql_num_rows($result)) { while($row=mysql_fetch_array($result)) { $id=$row["id"]; $cat_id=$row["cat_id"]; $name=$row["name"]; $dsc=$row["dsc"]; $url=$row["url"]; $image=$row["image"]; $email=$row["email"]; $password=$row["password"]; ?> <p class="bodylgbold">Edit a Link</p> <p class="bodysm"> > <a href="<?php echo $PHP_SELF; ?>">Home</a> > <a href="<?php echo $PHP_SELF."?ax=login"; ?>">Edit Login</a> > Edit <?php echo $name; ?></p> <form action="<?php echo $PHP_SELF; ?>?ax=update&id=<?php echo $id; ?>" method="post" name="form" onsubmit="return validate_edit();"> <table border="0" width="100%" cellspacing="2" cellpadding="0"> <tr> <td class="bodymd"><span style="color:#FF0000;">*</span>Category:<br /> <select name="cat_id"> <?php $result=MySQLQuery("select * from links_cat where id='$cat_id'",$QueryError_Email,$QueryError_Browser); while($row=mysql_fetch_array($result)) { $temp1_id=$row["id"]; $temp1_name=$row["name"]; echo "<option value='$temp1_id'> $temp1_name</option>"; } $result=MySQLQuery("select * from links_cat where id!='$cat_id' order by name",$QueryError_Email,$QueryError_Browser); while($row=mysql_fetch_array($result)) { $temp2_id=$row["id"]; $temp2_name=$row["name"]; echo "<option value='$temp2_id'> $temp2_name</option>"; } ?> </select> </td> </tr> <tr><td class="bodymd">Website Name<span style="color:#FF0000;">*</span>:<br /><input type="text" name="name" size="60" value="<?php echo $name ?>"/></td></tr> <tr><td class="bodymd">Website Description<span style="color:#FF0000;">*</span>:<br /><textarea name="dsc" rows="3" cols="40"><?php echo $dsc ?></textarea></td></tr> <tr><td class="bodymd">URL<span style="color:#FF0000;">*</span>:<br /><input type="text" name="url" size="60" value="<?php echo $url ?>"/></td></tr> <?php if($image_enabled=="yes"){ ?> <tr><td class="bodymd">Image URL:<br /><input type="text" name="image" size="60" value="<?php echo $image; ?>" maxlength="100"/></td></tr> <?php } ?> <tr><td class="bodymd"> Email:<br /><input type="text" name="email" size="50" value="<?php echo $email ?>"/></td></tr> <tr><td class="bodymd"> Password:<br /><input type="password" name="password" size="10" value="<?php echo $password ?>"/></td></tr> <tr><td class="bodymd"><span style="color:#FF0000;">*</span> - indicates required field</td></tr> <tr><td><input type="submit" name="submit" value="Edit Link"/></td></tr> </table> </form> <?php } } else { echo "<p class=\"bodylgbold\">No Records Found</p>"; echo "<p class=\"bodymd\">No web site listing can be found with that URL, email address or password.</p>"; echo "<p class=\"bodymd\"><a href=\"$PHP_SELF?ax=remind\">Click here</a> to get login info for all websites listed to your email address sent to you.</p>"; } } else if($ax=="update") { $cat_id=$_POST["cat_id"]; $name=$_POST["name"]; $dsc=$_POST["dsc"]; $url=$_POST["url"]; $email=$_POST["email"]; $password=$_POST["password"]; $image=$_POST["image"]; $result=MySQLQuery("update links set cat_id='$cat_id', name='$name', dsc='$dsc', url='$url', email='$email', password='$password', image='$image' where id=$id",$QueryError_Email,$QueryError_Browser); if ($result) { mail($admin_mail, "Link was modified at ".$site_title."", "The link ".$name." has been modified at ".$site_title."", "From: ".$admin_mail); if ($email && $password) { mail($email, "Link modified at ".$site_title."", "Your link has been modified.\n\nThanks for keeping it up to date.", "From: ".$noreply_mail); } echo "<p class=bodylgbold>The Link Was Updated</p>"; echo "<p class=\"bodysm\"><a href=\"".$PHP_SELF."\">Home</a> > <a href=\"$PHP_SELF?ax=login\">Edit Login</a> > Edit > $name Updated</p>"; echo "<p class=\"bodymd\">Your link update has been changed and the site administrator has been notified of the change.</p>"; echo "<p class=\"bodymd\">Your listing will remain in the directory during this time.</p>"; } else { echo "<p class=bodylgbold>Error Updating Link</p>"; } } ////////////////////////////// // Password Reminder Functions ////////////////////////////// else if($ax=="remind") { ?> <p class="bodylgbold">Get Your Login Information</p> <p class="bodymd">This will email you the login information for all URL's that have been submitted by the requested email address</p> <form action="<?php echo $PHP_SELF; ?>?ax=remindmail" method="post" id="form" onsubmit="return validate_remind();"> <table border="0" width="100%" cellspacing="2" cellpadding="0"> <tr><td class="bodymd">Email:<br /><input type="text" name="email" size="40"/></td></tr> <tr><td><input type="submit" name="submit" value="Email My Login Info"/></td></tr> </table> </form> <?php } else if($ax=="remindmail") { $msg=""; $result=MySQLQuery("select * from links where email='$email'",$QueryError_Email,$QueryError_Browser); if(mysql_num_rows($result)) { while($row=mysql_fetch_array($result)) { $name=$row["name"]; $url=$row["url"]; $email=$row["email"]; $password=$row["password"]; $msg="$msg Login Information for $name is as follows:\n URL: $url\n Email: $email\n Password: $password\n\n"; } $msg="$msg Thank you for using $Site_Name"; mail($email, "Login information from ".$GLOBALS["Site_Name"], $msg, "From: ".$GLOBALS["NoReply_Mail"]); Echo "<p class=bodylgbold>Email Sent</p><p class=bodymd>Your Login Information has been sent to $email.</p>"; } else { echo "<p class=\"bodylgbold\">No Records Found</p><p class=\"bodymd\">Sorry, no records were found registered to $email.</p>"; } } ////////////////// // Main Front Page ////////////////// else { $result = MySQLQuery("SELECT id,sub_cat,name FROM links_cat WHERE sub_cat='0' ORDER BY name ASC", $QueryError_Email,$QueryError_Browser); $count=0; if(mysql_num_rows($result)) { echo "<table cellpadding=\"0\" cellspacing=\"0\" style=\"border-style:none;width:100%;\">\n"; while($row=mysql_fetch_array($result)) { $count=$count+1; $id=$row["id"]; $sub_cat=$row["sub_cat"]; $name=$row["name"]; $dsc=$row["dsc"]; $link_count = MySQLQuery("SELECT * FROM links WHERE cat_id='".$id."' AND approved='yes' ORDER BY name ASC", $QueryError_Email,$QueryError_Browser); $link_count=mysql_num_rows($link_count); if($link_count==1){$link_text="link";}else{$link_text="links";} if($count <= $front_cols && $count==1){echo "<tr>\n<td align=\"left\" valign=\"top\" style=\"width:$front_perc;\">\n";} else if($count < $front_cols && $count > 1){echo "<td class=\"bodymd\"> </td>\n<td align=\"left\" valign=\"top\" style=\"width:$front_perc;\">\n";} else if($count==$front_cols){echo "<td class=\"bodymd\"> </td>\n<td align=\"left\" valign=\"top\" style=\"width:$front_perc;\">\n";} echo "<span class=\"bodymdbold\"><a href=\"$PHP_SELF?ax=list&sub=$id&cat_id=$id\">$name ($link_count $link_text)</a></span><br />\n"; $result2 = MySQLQuery("SELECT id,sub_cat,name FROM links_cat WHERE sub_cat='$id' ORDER BY name ASC", $QueryError_Email,$QueryError_Browser); if(mysql_num_rows($result2)) { echo "<ul class=\"bodysm\">"; while($row2=mysql_fetch_array($result2)) { $id2=$row2["id"]; $sub_cat2=$row2["sub_cat"]; $name2=$row2["name"]; $link_count = MySQLQuery("SELECT * FROM links WHERE cat_id='".$id2."' AND approved='yes' ORDER BY name ASC", $QueryError_Email,$QueryError_Browser); $link_count=mysql_num_rows($link_count); if($link_count==1){$link_text="link";}else{$link_text="links";} echo "<li><a href=\"$PHP_SELF?ax=list&sub=$sub_cat2&cat_id=$id2\">$name2 ($link_count $link_text)</a></li>\n"; } echo "</ul>"; } if($count <= $front_cols && $count==1){echo "<br /><br />\n</td>\n";} else if($count < $front_cols && $count > 1){echo "<br /><br />\n</td>\n";} else if($count==$front_cols){echo "<br /><br />\n</td>\n";} if($count==$front_cols){$count=0;} } if($count < $front_cols) { $spacer=($front_cols - $count) * 2; echo "\n<td class=\"bodymd\" colspan=\"$spacer\"> </td>\n"; } echo "</tr>\n</table>\n"; } else { echo "<p class=\"bodymd\">No categories found</p>"; } } include('footer.php'); ob_end_flush(); ?> Any help with this please?
  17. any way you could help me out with a simple code to accomplish that? I have been searching for some sort of link tracker all day and they keep coming up as large programs. Even a tutorial link would help greatly. Im having a hard problem finding one. I kind of thought that might be the case, doing it with the database instead, but any help you could provide would be much appreciated, between trying to do this and implement a clip dump in my site im driving myself crazy because neither are coming together :-( so thank you I greatly appreciate it.
  18. Right now I this code in order to show the menu based on size... here is the code. <?php function printTagCloud($tags) { // $tags is the array arsort($tags); $max_size = 32; // max font size in pixels $min_size = 12; // min font size in pixels // largest and smallest array values $max_qty = max(array_values($tags)); $min_qty = min(array_values($tags)); // find the range of values $spread = $max_qty - $min_qty; if ($spread == 2) { // we don't want to divide by zero $spread = 1; } // set the font-size increment $step = ($max_size - $min_size) / ($spread); // loop through the tag array foreach ($tags as $key => $value) { // calculate font-size // find the $value in excess of $min_qty // multiply by the font-size increment ($size) // and add the $min_size set above $size = round($min_size + (($value - $min_qty) * $step)); echo '<a href="#" style="font-size: ' . $size . 'px" title="' . $value . ' things tagged with ' . $key . '">' . $key . '</a> '; } } $tags = array('weddings' => 32, 'birthdays' => 9, 'landscapes' => 62, 'ham' => 51, 'chicken' => 23, 'food' => 9, 'turkey' => 47, 'windows' => 82, 'apple' => 27); printTagCloud($tags); ?> What I want to do is have those numbers that correspond with the menu item to change every time it is clicked so the most clicked item will always remain the largest. Can some one give me a little help on how to accomplish that? I would prefer to not use the database for this, but if needed then I am open to ideas. As long as it is not a security issue. Thank you. This sites great!
  19. MkPortal isn't a very helpful website when it comes to help, takes weeks some times to get simple answers. Im really just looking for some sort of example I can base my development off just so I can get a idea of what I need to do. You can download the program at www.mkportal.it and then you need to download the media module as well here http://mkportal.it/support/showthread.php?t=13275 thank you. I really appreciate the help. This has been on my agenda for a while now. Every time I search "php classid help" i get a thousand sites using classid's to call the files..
  20. Thats fine, If some one could just supply the code to do what I asked for I could alter it to fit mkportal. Or give me some help in how to accomplish this.
  21. I am currently running mkportal, and have the media module installed. I would like to give the members of my site the opportunity to post all the files elsewhere, is there a way I can alter the php to call upon the files a different way such as classid? or maybe the number assigned for that page since its page is given a number, it just stores every thing in one folder on the server.
×
×
  • 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.