]> git.mxchange.org Git - friendica.git/commitdiff
typo on previous checkin - set max number of images for an inserted link, default 2.
authorfriendica <info@friendica.com>
Fri, 14 Sep 2012 06:01:10 +0000 (23:01 -0700)
committerfriendica <info@friendica.com>
Fri, 14 Sep 2012 06:01:10 +0000 (23:01 -0700)
mod/admin.php
mod/parse_url.php

index 2d1d21bb475d3cf9a916d607621ee2519448d202..318858275b76901158bcbcb2492eb9a23d6f7937 100644 (file)
@@ -355,7 +355,7 @@ function admin_page_site_post(&$a){
                set_config('system','directory_submit_url', $global_directory);
        }
        set_config('system','thread_allow', $thread_allow);
-       set_config('system','newuser_private', $newuser_private;
+       set_config('system','newuser_private', $newuser_private);
 
        set_config('system','block_extended_register', $no_multi_reg);
        set_config('system','no_openid', $no_openid);
index 083a39b55f9012d2733ad55118d41c664d1b38b6..9adee8f65cd8d7d9c261f6d16522ea2ed0859cd9 100644 (file)
@@ -307,16 +307,26 @@ function parse_url_content(&$a) {
 
        $image = "";
 
-        if(sizeof($siteinfo["images"]) > 0){
-            /*
-              Execute below code only if image is present in siteinfo
-             */
-            foreach ($siteinfo["images"] as $imagedata)
-               if($textmode)
-                    $image .= '[img='.$imagedata["width"].'x'.$imagedata["height"].']'.$imagedata["src"].'[/img]';
+       if(sizeof($siteinfo["images"]) > 0){
+               /* Execute below code only if image is present in siteinfo */
+
+               $total_images = 0;
+               $max_images = get_config('system','max_bookmark_images');
+               if($max_images === false)
+                       $max_images = 2;
                else
-                    $image .= '<img height="'.$imagedata["height"].'" width="'.$imagedata["width"].'" src="'.$imagedata["src"].'" alt="photo" />';
+                       $max_images = intval($max_images);
+
+               foreach ($siteinfo["images"] as $imagedata) {
+                       if($textmode)
+                               $image .= '[img='.$imagedata["width"].'x'.$imagedata["height"].']'.$imagedata["src"].'[/img]' . "\n";
+                       else
+                               $image .= '<img height="'.$imagedata["height"].'" width="'.$imagedata["width"].'" src="'.$imagedata["src"].'" alt="photo" /><br />';
+                       $total_images ++;
+                       if($max_images && $max_images >= $total_images)
+                               break;
         }
+       }
 
        if(strlen($text)) {
                if($textmode)