Current time: 09-07-2010, 01:23 PM Hello There, Guest! (LoginRegister)


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
RSS 2 MYSQL Script - Share external Rssfeeds
02-21-2008, 10:48 AM (This post was last modified: 06-08-2009 09:09 AM by NoX.)
Post: #1
RSS 2 MYSQL Script - Share external Rssfeeds
hi,

i'm a lazy person Smile so i search a script with them i can share the external rss feeds from other tutorial pages Smile

so i found a script and upgrade the script with title check and external image linking Smile


//Update..

i've upload a new Version from the RSS2MYSQL Script...

Now it's only 1 file, which has all rss feeds in an array...

Its easy to expand...

i've insert 2 example categories.. but i have no time to test it (i had it in another program)...

if you have problems with the new script, let me know it... Wink


Attached File(s)
.php  rss_import.php (Size: 4.31 KB / Downloads: 20)

Kind regards,
Marcus

Projects: Webstone.info
Visit this user's website Find all posts by this user
Quote this message in a reply
08-10-2008, 06:01 AM
Post: #2
Re: RSS 2 MYSQL Script - Share external Rssfeeds
Hello, Thank you for providing this great script.

I am trying to install this on my server, I have two questions:

1- Where do I install the files? ( I installed them at the root)
2- What is the standard command for the cronjob for this? I tried using something along the lines of
Code:
0 * * * * /usr/local/bin/php -q /home/tom/public_html/rss_flash.php
but didn't seem to work.

I also tried typing in
Code:
http://www.mydomain.com/rss_flash.php
but that didn't work either
Find all posts by this user
Quote this message in a reply
08-10-2008, 08:13 AM
Post: #3
Re: RSS 2 MYSQL Script - Share external Rssfeeds
hi,

to 1.

i have upload this script in the directory "rss2mysql" and not in the root directory,
but you can upload it to any directory (root or /directory/subdirectory/.../) it works anywhere Smile

to 2.

yes, you must use this one "http://www.mydomain.com/rss_flash.php"

but do you have edit the config.inc.php and import the sql.sql into your database?


greetz
marcus

Kind regards,
Marcus

Projects: Webstone.info
Visit this user's website Find all posts by this user
Quote this message in a reply
08-10-2008, 01:47 PM
Post: #4
Re: RSS 2 MYSQL Script - Share external Rssfeeds
hehe, no I hadn't dumped the SQL.

I will do it in a couple of hours and post how it goes.

thank you NoX!
Find all posts by this user
Quote this message in a reply
08-11-2008, 01:11 AM
Post: #5
Re: RSS 2 MYSQL Script - Share external Rssfeeds
Okay I did it, it gets the tutorials but the images are now showing up from pixel2life.com. Here are the errors I get on http://www.mydomain.com/rss_flash.php

When right click on the images and hit view image I get:

http://mydomain.com/http://www.pixel2lif.../62468.gif (perhaps thats why) it doesn't get it from the site itself but puts my domain in front.

Warning: fopen(/home/semihg/public_html/mydomain.comitems/25909c18a1020d066456756802ffa4ad) [function.fopen]: failed to open stream: No such file or directory in /home/semihg/public_html/mydomain.com/rss_flash.php on line 174

I realize with this error the item folder and the subfolder are not separated...


Warning: fwrite(): supplied argument is not a valid stream resource in /home/semihg/public_html/mydomain.com/rss_flash.php on line 175

Warning: fclose(): supplied argument is not a valid stream resource in /home/semihg/public_html/mydomain.com/rss_flash.php on line 176


You should also know that I am using Shared hosting with add on domains. And this domain happens to be an addon rather than the main domain on the account.

The tutorials work just fine, they are shown and grabbed from the source but the images aren't, weird... Can you help? Thanks in advance!
Find all posts by this user
Quote this message in a reply
08-11-2008, 12:56 PM
Post: #6
Re: RSS 2 MYSQL Script - Share external Rssfeeds
hi,
i've edit the tutorials.php in the includes directory...
i will show about the source when i'm home...

but you must edit the class where the turorials list Smile


greetz
marcus

Kind regards,
Marcus

Projects: Webstone.info
Visit this user's website Find all posts by this user
Quote this message in a reply
08-13-2008, 03:52 PM
Post: #7
Re: RSS 2 MYSQL Script - Share external Rssfeeds
Hi NOX, thank you for your help.

After we have done some of those modifications now my RSS feed system doesn't work at all. Meaning it doesn't grab tutorials any more.

Can you help me with this?
Find all posts by this user
Quote this message in a reply
08-14-2008, 02:26 PM
Post: #8
Re: RSS 2 MYSQL Script - Share external Rssfeeds
hi,

need a link to see the error ^^

greetz
marcus

Kind regards,
Marcus

Projects: Webstone.info
Visit this user's website Find all posts by this user
Quote this message in a reply
10-01-2008, 07:59 AM
Post: #9
Re: RSS 2 MYSQL Script - Share external Rssfeeds
Im having the same problems as tuton. The tutorial icons aren't showing because its placing my domain url in front of the image url e.g (http://www.pixel-edit.com/http://www.pix.../47935.gif)

Any idea how we can fix this?
Visit this user's website Find all posts by this user
Quote this message in a reply
10-01-2008, 09:53 PM
Post: #10
Re: RSS 2 MYSQL Script - Share external Rssfeeds
hi,

you must replace the upload_avatar function in /include/functions.php with

Code:
function upload_avatar($avatar, $key, $id) {
    $error = 1;
    $valid_image_types = array('.gif', '.jpg', '.png');
    $tmp_name = $avatar['tmp_name'][$key];
    $size = $avatar['size'][$key];
    $filename = $avatar['name'][$key];
    if($size > NUMBER_MAX_ICON_SIZE) {
        $error = 2;    
    }
    $type = strtolower(strrchr($filename, '.'));
    if(!in_array($type, $valid_image_types)) {
        $error = 2;
    }
    if($error == 1) {
        $name = 'images/avatars/'.$id.$type;
        list($width, $height) = getimagesize($tmp_name);
        if($width != NUMBER_DIMENSIONS_W || $height != NUMBER_DIMENSIONS_H) {
            $image_p = imagecreatetruecolor(NUMBER_DIMENSIONS_W, NUMBER_DIMENSIONS_H);
            if($type == '.gif') {
                $image = imagecreatefromgif($tmp_name);
                imagecopyresampled($image_p, $image, 0, 0, 0, 0, NUMBER_DIMENSIONS_W, NUMBER_DIMENSIONS_H, $width, $height);
                imagegif($image_p, $name);                
            }elseif($type == '.jpg') {
                $image = imagecreatefromjpeg($tmp_name);
                imagecopyresampled($image_p, $image, 0, 0, 0, 0, NUMBER_DIMENSIONS_W, NUMBER_DIMENSIONS_H, $width, $height);
                imagejpeg($image_p, $name, 100);
            }else{
                $image = imagecreatefrompng($tmp_name);
                imagecopyresampled($image_p, $image, 0, 0, 0, 0, NUMBER_DIMENSIONS_W, NUMBER_DIMENSIONS_H, $width, $height);
                imagepng($image_p, $name, 9);
            }
            chmod($name, 0644);
        }else{
            move_uploaded_file($tmp_name, $name);
            chmod($name, 0644);
        }
        mysql_query("UPDATE `tutorial_front` SET `icon`='".HTTP_SERVER.$name."' WHERE `id`='".$id."'");
    }else{
        mysql_query("UPDATE `tutorial_front` SET `icon`='default' WHERE `id`='".$id."'");
    }
}



then you must edit the tutorial_bit template

find

Code:
<img alt="$tutorial_bit[id]" style="border-top: 1px solid #bcdaf4;border-left: 1px solid #bcdaf4;" src="$config[HTTP_SERVER]$tutorial_bit[icon]" width="$config[NUMBER_DIMENSIONS_W]" height="$config[NUMBER_DIMENSIONS_W]">

replace with

Code:
<img alt="$tutorial_bit[id]" style="border-top: 1px solid #bcdaf4;border-left: 1px solid #bcdaf4;" src="$tutorial_bit[icon]" width="$config[NUMBER_DIMENSIONS_W]" height="$config[NUMBER_DIMENSIONS_W]">



tested in tutorialMS 1.3!


greetz
marcus

Kind regards,
Marcus

Projects: Webstone.info
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump: