select images for submission in development

Register an Account
Closed Thread
 
Thread Tools Display Modes
  #61 (permalink)  
Old 06-11-2009, 03:35 AM
New Pligger
Pligg Version: 1
 
Join Date: Jun 2009
Posts: 1
Quote:
Originally Posted by Yankidank View Post
If you're looking for a feature similar to how Digg.com finds images from teh submitted url and crops them into a square that has not yet been developed for Pligg 1.0. I know of another company who developed a version of this, but it was never as clean as the Digg procss.
Hi Yankidank, I am new to pligg forums and was searching for this module where the images are being brought from the submitted url and the user can select one of the images. Do you have any idea when this module would be developed. It is one of the best modules and it would be a great addition if this could be added in the upcoming pligg versions.
  #62 (permalink)  
Old 06-11-2009, 11:56 AM
Yankidank's Avatar
Pligg Founder/Coder/Designer
Pligg Version: SVN
Pligg Template: Wistie
 
Join Date: Dec 2005
Location: Ocala, FL
Posts: 4,934
Send a message via AIM to Yankidank
If someone wants to sponsor the module (pay $300-400) I will have it developed. We are thinking about offering a sponsorship program where users put up the development cost and we sell the item on the Pligg Pro Shop. Then the sponsor would earn back his contribution as the module is sold.

The Twitter Module for Pligg CMS!
Register, Login, and Submit Stories with Twitter. An absolute MUST HAVE for all Pligg sites!
  #63 (permalink)  
Old 07-28-2009, 04:08 PM
Constant Pligger
Pligg Version: 1.0.1
Pligg Template: thestandard
 
Join Date: Jun 2009
Posts: 125
Send a message via Yahoo to prorock
Is possible to exist this module soon?
  #64 (permalink)  
Old 07-28-2009, 04:47 PM
s010's Avatar
Casual Pligger
Pligg Version: 1.0.0
Pligg Template: Custom
 
Join Date: Jul 2009
Posts: 45
Quote:
Originally Posted by Yankidank View Post
We are thinking about offering a sponsorship program where users put up the development cost and we sell the item on the Pligg Pro Shop. Then the sponsor would earn back his contribution as the module is sold.
I think this is an awesome idea

fwisp - Discover and Share Business, Economy, Finance News, Articles and Videos
  #65 (permalink)  
Old 08-15-2009, 10:42 AM
Pligg Donor
Pligg Version: 1.0.1
Pligg Template: The Standard
 
Join Date: Dec 2008
Location: Canada
Posts: 16
Quote:
Originally Posted by s010 View Post
I think this is an awesome idea
I think this is a great idea as well. And I can already think of one module I'd sponsor.
  #66 (permalink)  
Old 10-15-2009, 10:58 PM
New Pligger
Pligg Version: 1.0.0
 
Join Date: Oct 2009
Posts: 17
Quote:
Originally Posted by Yankidank View Post
If someone wants to sponsor the module (pay $300-400) I will have it developed. We are thinking about offering a sponsorship program where users put up the development cost and we sell the item on the Pligg Pro Shop. Then the sponsor would earn back his contribution as the module is sold.
Hi Yankidank thanks for your support, i am new to this forum and searching this module

Why you not developing this module by self and sell in pro
I think people will like and buy this module and you get $$
  #67 (permalink)  
Old 11-03-2009, 02:11 AM
New Pligger
 
Join Date: Oct 2009
Posts: 13
Hi Yankidank
I want module where the images will grab with url of the site .
Is there any module?
If it is for sell tell me about it.
  #68 (permalink)  
Old 11-03-2009, 11:17 AM
Yankidank's Avatar
Pligg Founder/Coder/Designer
Pligg Version: SVN
Pligg Template: Wistie
 
Join Date: Dec 2005
Location: Ocala, FL
Posts: 4,934
Send a message via AIM to Yankidank
There is no such module provided by us at this point. It may be a module that we work on after we have come up with some anti-spam modules. Right now our focus is on fighting spam.

The Twitter Module for Pligg CMS!
Register, Login, and Submit Stories with Twitter. An absolute MUST HAVE for all Pligg sites!
  #69 (permalink)  
Old 11-11-2009, 04:18 AM
New Pligger
 
Join Date: Oct 2009
Posts: 13
Quote:
Originally Posted by ivytony View Post
When users submit a url, I would like to have my pligg craw on that target url and catch images for users to choose for the submission, which is just like digg's submission.

now, you can type in any url in uspie.net to get images. I have set my script to filter out smaller images from webpage design such as corners, spacers, etc. Currently, images smaller than 150px width and 40px height are filtered out. Large images are also scaled proportionally.

I wonder how to make the images out as radio buttons for users to choose from, anyone can give me a hint on this??

thanks!

Edit on July 17, 2008:

Here's the mod:

1. In your submit.php file, find the function do_submit1, around line 211 (or somewhere after the code: $linkres->status='discard';
$linkres->author=$current_user->user_id;
$linkres->store(),

add

PHP Code:
//catch images on destination url
    
$pageString = @file_get_contents($url);
    
preg_match_all('|<img .*?>|s'$pageString$matches);
    
//the array $matches[0] now contains the img tags, let's echo 'em:

$fulldomain 'http://www.'$domain;

$newimages = array();  //initialize an array as image container

foreach ($matches[0] as $path){

preg_match('/src="([^"]+)"/',$path$b); //get the image path by $b[1], however, will need to detect relative paths and convert to absolute paths

$location $linkres->relative2absolute($fulldomain$b[1]);//this is to convert relative image paths to absolute image paths

$filteredimg $linkres->filterimage($location120120);
 if (
$filteredimg) {
    
$image $linkres->scaleimage($filteredimg100100); //scale bigger images and filter out images smaller than 100x100. You can modify the picture dimensions limit based on your needs.
    
    
$newimages[] = array(
       
'url' => $location,
       
'img_tag' => $image,
        );
  }
}
 
$main_smarty->assign('newimages'$newimages);
//end of get images 
In the same submit.php file, after the code line ( if(isset($_POST['link_field15'])){$linkres->link_field15 = strip_tags(trim($_POST['link_field15']), Story_Content_Tags_To_Allow);}), add the following:

PHP Code:
//reset link_field1 as $product_image
if(!empty($product_image_manual)){           //entered manually by user
$linkres->link_field1 $product_image_manual;

}
else {
  if(!empty(
$linkres->product_image)){
  
$linkres->link_field1 $linkres->product_image;   //use link_field1 to store the image path
  
}

Now, find the link.php in the /libs folder, anywhere between two function close brackets, add the following code
PHP Code:
    //Tony, get images 20080226
function relative2absolute($absolute$relative) {
        
$p = @parse_url($relative);
        if(!
$p) {
            
//$relative is a seriously malformed URL
            
return false;
        }
        if(isset(
$p["scheme"])) return $relative;
 
        
$parts=(parse_url($absolute));
 
        if(
substr($relative,0,1)=='/') {
            
$cparts = (explode("/"$relative));
            
array_shift($cparts);
        } else {
            if(isset(
$parts['path'])){
                 
$aparts=explode('/',$parts['path']);
                 
array_pop($aparts);
                 
$aparts=array_filter($aparts);
            } else {
                 
$aparts=array();
            }
           
$rparts = (explode("/"$relative));
           
$cparts array_merge($aparts$rparts);
           foreach(
$cparts as $i => $part) {
                if(
$part == '.') {
                    unset(
$cparts[$i]);
                } else if(
$part == '..') {
                    unset(
$cparts[$i]);
                    unset(
$cparts[$i-1]);
                }
            }
        }
        
$path implode("/"$cparts);
 
        
$url '';
        if(
$parts['scheme']) {
            
$url "$parts[scheme]://";
        }
        if(isset(
$parts['user'])) {
            
$url .= $parts['user'];
            if(isset(
$parts['pass'])) {
                
$url .= ":".$parts['pass'];
            }
            
$url .= "@";
        }
        if(isset(
$parts['host'])) {
            
$url .= $parts['host']."/";
        }
        
$url .= $path;
 
        return 
$url;
}

function 
filterimage($location$minW=NULL$minH=NULL){
 
$img = @getimagesize($location);
   if (
$img){                      //if image exists
    
$w $img[0];
    
$h $img[1];

        if (
$w >= $minW && $h >= $minH){   //only if images greater than the minimums are they returned, otherwise, no
        
return $location;
        }
        else {
        return 
false;                  //return no images
        
}
    }
}

function 
scaleimage($location$maxw=NULL$maxh=NULL$alt=NULL$title=NULL){
    
$img = @getimagesize($location);
    if(
$img){
        
$w $img[0];
        
$h $img[1];

        
$dim = array('w','h');
        foreach(
$dim AS $val){
            
$max "max{$val}";
            if(${
$val} > ${$max} && ${$max}){
                
$alt = ($val == 'w') ? 'h' 'w';
                
$ratio = ${$alt} / ${$val};
                ${
$val} = ${$max};
                ${
$alt} = ${$val} * $ratio;
            }
        }

       return(
"<img src='{$location}' alt='{$alt}' width='{$w}' height='{$h}' title='{$title}'/>");

    }
}

    
//enf of get images 
You are almost done. Hang on! Next is to show the images on your template. In the submit_step2.tpl file, add the following html code to somewhere you think appropriate:



Because it has been too long since I coded for this mod, I forgot much of it. If you have any question, please post it in this thread so that I or someone else can figure out together.

For you to see the mod in action, you can take a look at my website DealsPiggy / Hot Deals or see this script stand-alone here: deal piggy hotel travel at dealspiggy.com

Good luck!
It works on my submit page but not for other image url like:http://web.mit.edu/newsoffice//image...3123420-1.jpg(here // are used) and also
http://sample.com/newsoffice/images imgs/images/article_images/20091103123420-1.jpg(where white underscore is used images imgs)
Please help

Last edited by shashank2009; 11-16-2009 at 03:18 AM.
  #70 (permalink)  
Old 11-12-2009, 03:32 AM
New Pligger
 
Join Date: Oct 2009
Posts: 13
Hello!
I am near to complete image upload module like Digg.com
I have attach some screen for sample.


but I have some problem for fetching some image from the sites which have this type of HTML Tags <td> <span class="fa fs12 fb lh16 mart15 marb5 lh18"><a href="http://www.ndtv.com/news/world/nasa_ready_for_atlantis_launch_so_is_twitter.php"> <img src="http://www.ndtv.com/news/images/atlantisbig.jpg" border="0" class="mart5 marb5" id="story_photo_11571" /></a></span><br /> </td>(there is no <div> tags)

Please help me after solving this problem I will provide it to all of you
Attached Thumbnails
select images for submission in development-sample.gif   select images for submission in development-sample2.gif  

Last edited by shashank2009; 11-16-2009 at 06:40 AM.
Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
RSS importer doesn't import images from feeds lostdeviant Questions and Comments 12 03-22-2009 10:35 PM
Profile Badges and Images EASY work 30 usd winner! bbrian017 Questions and Comments 0 04-25-2008 11:47 AM
The Real Cause Of High Load For My Server Using PLigg 9.9 and Was 9.8.2 argh2xxx Questions and Comments 18 01-10-2008 05:33 PM
'max_user_connections' suddenly exceeded mightyb Questions and Comments 10 06-13-2007 05:40 PM


Pligg Modules and Pligg Templates from Pligg Pro Find support on the Pligg CMS Forum - 24 hours a day! Make a donation to support Pligg CMS development