Jump to content

cihan

Members
  • Posts

    12
  • Joined

  • Last visited

    Never

Everything posted by cihan

  1. I thing it was a bad idea what i want to do, just forget about it and thanks for helping me to Bricktop and thebadbad.
  2. i'm trying to put the permalink into this php code: <?php $url = "http://blabla.com"; $allowedDomains = array ( 'rapidshare', 'megaupload', 'depositfiles', 'letitbit', 'hotfile', 'sherebee', 'filefactory', 'zshare', 'sendspace', 'uploadbox', 'uploading', '4shared', 'gigasize', 'mediafire', 'netload', 'linksave', 'filehoster', 'rghost', 'protector' ); $page = file_get_contents($url); preg_match_all("/<a.*?href=(\"|\')(.*?)\\1.*?>.*?<\/a>/is", $page, $matches); echo "<pre>"; //print_r($matches); echo "<pre>"; echo "Download Links:"; echo "<ul> "; foreach ($matches[2] as $match) { $validDomain = false; foreach ($allowedDomains as $domain) { if (strpos($match, $domain)) { $validDomain = true; break; } } if ($validDomain) { echo "<li><a href=\"{$match}\">{$match}</a></li>"; } } echo "</ul> "; ?> and get_the_permalink(); is not working, either...
  3. Do you mean: $url = "the_permalink();"; or $url = the_permalink(); I tried both of them but not working... Warning: file_get_contents(the_permalink() [function.file-get-contents]: failed to open stream: No such file or directory
  4. Hi, i'm a wordpress user and i have a php code, and in that php code there is an area to put a url in: $url = "http://blabla.com"; Well, in wordpress you can display post permalinks with this code: <?php the_permalink(); ?> What i want to do is putting <?php the_permalink(); ?> instead of http://blabla.com above in the php code. Target is: Getting permalinks and putting them there in php code, and let the php code use them to do its job. Is that possible? If yes, how with an example please...Thank you...
  5. Thank you mjdamato for your help again, you're a php genie! Yes you're right "the_permalink() is used to display the link to the current post being displayed" i'll point the permalink to the website content where the rapidshare links grabbed. if you know just show me how can i insert this permalink into the php code please. Or i have another idea: I want to create a rss feed xml or php file that takes only permalinks of another website (you see the only problem is taking that link to grab the rapidshare etc. links under its content) and put the php code you've written in description or content area of the feed file (because i want the rapidshare links as description/content of the feed items), php code uses (for each feed item/permalink) permalinks to grab the rapidshare etc. links and puts them into description area. so when i fetch that feed file 1 time i got all these links and i can put them into my wordpress posts. it's better to run the code in wordpress template files for each page load. About the great php code you wrote: It's really powerful and works great. i don't know if it's possible the hide the output rapidshare vs. links under a (click to display the download links written on it) javascript etc. button. I hope i don't want the impossible thing. Thank you again and again for your great help ! I'm modifying my post cause i have an another idea: Grabbing rapidshare etc. links with a php code from defined 3,4 websites for given keywords. and using the <?php the_title(); ?> code to get the title in wordpress as given keywords.
  6. I'm little bit confused, well i don't know what's the difference between your preg_match_all and the mjdamato's? can i prefer one of them or both suits the code?
  7. Thanks a lot mjdamato for fast replying and help, the code works like a charm ! I think it doesn't matter if the links under an image or button. Code can still grab them? The urls are displayed in text format. Can we make them clickable? And the last question: I want to put this php code into wordpress posts. In wordpress i can call permalinks with <?php the_permalink(); ?> , it's not working when i try to put this permalink php code into the php code (where http://www.somesite.com is) you've written. i think it's simply because i'm trying to put a php code into another php code but i don't know what to do. Is there any solution about that? i know i'm asking many questions and requesting much help and taking your time but i'm really interested in php, it's like a magic. Thanks again...
  8. Now it works ! Thanks a lot mjdamato and cags ! This forum is great ! said mjdamato. Is there anybody have some time to add these scenarios to the existing code above? Thanks in advance...
  9. At first, thank you for your answer. I get the following error when i try to use the code: Parse error: syntax error, unexpected '(' in /home/cihan/public_html/xxxxxxxxxxxx.com/wp-content/themes/clean-minimal/index.php on line 12
  10. Hi, i'm a newbee and this is my first post. I need some help to change this code: $page = 0; $URL = "http://www.blabla.com/"; $page = @fopen($URL, "r"); print("Links at $URL<BR>\n"); print("<UL>\n"); while(!feof($page)) { $line = fgets($page, 255); while(eregi("HREF=\"[^\"]*\"", $line, $match)) { print("<LI>"); print($match[0]); print("<BR>\n"); $replace = ereg_replace("\?", "\?", $match[0]); $line = ereg_replace($replace, "", $line); } } print("</UL>\n"); fclose($page); This code grabs links from a page as text. It works good. but what i want is grabbing only rapidshare,megaupload and some other popular filehost links as clickable format. May somebody change this code for that? Thank you...
×
×
  • 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.