示例#1
0
        }
    }
}
//Getting And Listing Files
if (!file_exists(BASEDIR . '/' . TEMPLATEFOLDER . '/' . @$_GET['temp']) || @$_GET['temp'] == '') {
    $dir = SITETEMPLATEDIR . '/layout/';
    $cur_dir = TEMPLATE;
} else {
    $dir = BASEDIR . '/' . TEMPLATEFOLDER . '/' . $_GET['temp'] . '/layout/';
    $cur_dir = $_GET['temp'];
}
if (!($dp = opendir($dir))) {
    die("Cannot open {$dir}.");
}
while ($file = readdir($dp)) {
    $ext = GetExt($file);
    if ($ext == 'html' || $ext == 'HTML') {
        $files[] = $file;
    }
}
closedir($dp);
sort($files);
Assign('files', $files);
//Writng File
if (isset($_POST['save'])) {
    $file = $dir . $_POST['file'];
    $data = stripslashes($_POST['data']);
    $open_file = fopen($file, "w");
    fwrite($open_file, $data);
    $msg = $_POST['file'] . " Has Been Saved And Updated";
}
示例#2
0
function PrintMsg($f, $level)
{
    global $l10nstr;
    global $table;
    global $FirstMsg;
    global $ThreadTop;
    global $ShowMsg;
    global $mainfile;
    global $editscript;
    global $descscript;
    global $banscript;
    global $scriptsurl;
    global $addfilescript;
    global $nulfrm;
    global $userfiles;
    global $MsgPerPage;
    global $msgread;
    global $IsManager;
    global $name;
    $query = "SELECT * FROM {$table} WHERE ancestor={$f}";
    if ($f == 0 && $FirstMsg > 0) {
        $query .= " AND num<={$FirstMsg}";
    }
    if ($f == 0) {
        if ($ThreadTop) {
            $query .= " AND num={$ThreadTop}";
        }
        $query .= " ORDER BY lastmod DESC, date DESC, time DESC";
        $query .= " LIMIT {$MsgPerPage}";
        //print "$query<BR>\n";
    } else {
        $query .= " ORDER BY date DESC, time DESC";
    }
    $result = mysql_query($query);
    if (!$result) {
        echo mysql_error();
        exit;
    }
    if (mysql_num_rows($result) == 0) {
        return;
    }
    /* end of recursive call */
    while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
        $msgnum = $line['num'];
        $title = $line['title'];
        $user = $line['name'];
        $title = SpecialCodes($title);
        //print "<LI type=disc dir=RTL><BIG><A id=t$msgnum HREF=\"javascript:void(0)\" onclick=\"blocking('msg$msgnum', 't$msgnum')\">$title</A></BIG> - ";
        // search if message was read...
        /*	if($level == 0)
        			print "<BR>\n";
        		print "<LI type=disc dir=RTL>"; */
        if ($level == 0) {
            print "<TABLE width=100% height=\$3px><TR><TD></TABLE>\n";
        }
        print "<TABLE dir=RTL border=0 width=100% cellpadding=0 cellspacing=0>\n";
        print "<TR>\n";
        print "<TD width={$i}%>\n";
        print "<TD dir=RTL>\n";
        if ($level == 0) {
            print "<UL><LI type=disk>";
        } else {
            print "<UL><LI type=circle>";
        }
        if (array_search($msgnum, $msgread)) {
            print "<A id=t{$msgnum} HREF={$nulfrm}?msg={$msgnum}&forum={$table} target=trce onclick=\"blocking('msg{$msgnum}', 't{$msgnum}')\"><FONT color=#ff0000>{$title}</FONT></A>";
        } else {
            print "<A id=t{$msgnum} HREF={$nulfrm}?msg={$msgnum}&forum={$table} target=trce onclick=\"blocking('msg{$msgnum}', 't{$msgnum}')\">{$title}</A>";
        }
        print "<TD width=20%>\n";
        print "<A HREF={$descscript}?action=user&usrname={$user}&forum={$table} target=_blank>";
        $alias = GetAlias($user);
        if (IsForumManager($user)) {
            print "<BIG><B><FONT color=blue>{$alias}</FONT></B></BIG></A>\n";
        } else {
            if ($user == $name) {
                print "<BIG><B><FONT color=black>{$alias}</FONT></B></BIG></A>\n";
            } else {
                print "{$alias}</A>\n";
            }
        }
        $date = $line['date'];
        $time = $line['time'];
        $datearr = explode('-', $date);
        $timearr = explode(':', $time);
        $datetimestr = GetTimeStr($timearr[0], $timearr[1], $timearr[2], $datearr[1], $datearr[2], $datearr[0]);
        // $date = "$datearr[2]/$datearr[1]/$datearr[0]";
        print "<TD width=25%>\n";
        print "<FONT dir=LTR>";
        print "{$datetimestr}</FONT></LI>\n";
        /* Put message contents as DIV that will be displayed when clicking on message */
        $contents = $line['contents'];
        $contents = SpecialCodes($contents);
        print "<TR>\n";
        $i = $level * 2;
        print "<TD width={$i}%>\n";
        print "<TD bgcolor=#fff8ff colspan=3>\n";
        if ($ShowMsg == $msgnum) {
            print "<DIV id=msg{$msgnum}>";
        } else {
            print "<DIV class=para id=msg{$msgnum}>";
        }
        print "{$contents}<BR>\n";
        $pic = $line['picture'];
        if (!empty($pic)) {
            $ext = GetExt($pic);
            if (IsImg($ext)) {
                $s = getimagesize("{$userfiles}/{$pic}");
                $w = $s[0];
                $h = $s[1];
                if ($w > 100) {
                    $ar = $h / $w;
                    $h = 100 * $ar;
                    $w = 100;
                }
                print "<A HREF={$userfiles}/{$pic}><IMG SRC={$userfiles}/{$pic} width={$w} height={$h} border=0></A><BR><BR>\n";
            } else {
                print "<A HREF={$userfiles}/{$pic}>";
                print "מצורף קובץ: ";
                print "{$ext}</A><BR>\n";
            }
        }
        $url = $line['url1'];
        $urldesc = $line['urldesc1'];
        if (!empty($urldesc) && !empty($url)) {
            print "<A HREF={$url} target=_blank>{$urldesc}</A><BR>\n";
        }
        $url = $line['url2'];
        $urldesc = $line['urldesc2'];
        if (!empty($urldesc) && !empty($url)) {
            print "<A HREF={$url} target=_blank>{$urldesc}</A><BR>\n";
        }
        $url = $line['url3'];
        $urldesc = $line['urldesc3'];
        if (!empty($urldesc) && !empty($url)) {
            print "<A HREF={$url} target=_blank>{$urldesc}</A><BR>\n";
        }
        print "<BR><A href={$editscript}?forum={$table}&action=reply&ancestor={$msgnum}>{$l10nstr['22']}</A>\n";
        /* response */
        if (editable($user)) {
            print "&nbsp; &nbsp;\n";
            print "<A href={$editscript}?forum={$table}&action=edit&num={$msgnum}>{$l10nstr['23']}</A>\n";
            /* edit message */
            print "&nbsp; &nbsp;\n";
            print "<A HREF=\"javascript:void(0)\" onclick=\"javascript:AddFile('{$addfilescript}?forum={$table}&num={$msgnum}');\">";
            print "{$l10nstr['24']}";
            /* add file to message */
            print "</A>\n";
        }
        if (deleteable($user, $msgnum)) {
            print "&nbsp; &nbsp;\n";
            print "<A href={$editscript}?forum={$table}&action=delete&num={$msgnum}>{$l10nstr['25']}</A>\n";
            /* delete message */
        }
        if ($IsManager) {
            print "&nbsp; &nbsp;<A HREF={$banscript}?forum={$table}&user={$user}>{$l10nstr['26']}</A>\n";
            /* ban a user */
            print "&nbsp; &nbsp; &nbsp; {$msgnum}\n";
        }
        print "<BR><BR></DIV>\n";
        print "</TABLE>\n";
        /* spacing table */
        print "<TABLE width=100% height=\$3px><TR><TD></TABLE>\n";
        /* recursive call */
        PrintMsg($msgnum, $level + 1);
    }
}
示例#3
0
 function setFicon_type()
 {
     list($this->file_type, $this->file_icon) = split("\\?", GetExt($this->file_ext), 2);
 }
示例#4
0
function GetPage($res = '')
{
    $image = $res['image'];
    if (empty($image)) {
        $image = '0.jpg';
    }
    $data = '
	<div id="dialog-form">
	    <fieldset>
	    	<legend>ძირითადი ინფორმაცია</legend>

	    	<table class="dialog-form-table">
				<tr>
					<td style="width: 170px;"><label for="name">სახელი, გვარი</label></td>
					<td>
						<input type="text" id="name" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res['name'] . '" />
					</td>
				</tr>
				<tr>
					<td style="width: 170px;"><label for="tin">პირადი ნომერი</label></td>
					<td>
						<input type="text" id="tin" class="idle user_id" onblur="this.className=\'idle user_id\'" onfocus="this.className=\'activeField user_id\'" value="' . $res['tin'] . '" />
					</td>
				</tr>
				<tr>
					<td style="width: 170px;"><label for="position">თანამდებობა</label></td>
					<td>
						<select id="position" class="idls">' . GetPosition($res['position']) . '</select>
					</td>
				</tr>
			    <tr>
					<td style="width: 170px;"><label for="dep_id">განყოფილება</label></td>
					<td>
						<select id="dep_id" class="idls">' . GetDep($res['dep_id']) . '</select>
					</td>
				</tr>
				<tr>
					<td style="width: 170px;"><label for="ext">ექსთენშენი</label></td>
					<td>
						<select id="ext" class="idls">' . GetExt($res['ext']) . '</select>
					</td>
				</tr>
				<tr>
					<td style="width: 170px;"><label for="address">მისამართი</label></td>
					<td>
						<input type="text" id="address" class="idle address" onblur="this.className=\'idle address\'" onfocus="this.className=\'activeField address\'" value="' . $res['address'] . '" />
					</td>
				</tr>
				<tr>
					<td style="width: 170px;"><label for="home_number">სახლის ტელ: </label></td>
					<td>
						<input type="text" id="home_number" class="idle address" onblur="this.className=\'idle address\'" onfocus="this.className=\'activeField address\'" value="' . $res['home_number'] . '" />
					</td>
				</tr>
				<tr>
					<td style="width: 170px;"><label for="mobile_number">მობილური ტელ: </label></td>
					<td>
						<input type="text" id="mobile_number" class="idle address" onblur="this.className=\'idle address\'" onfocus="this.className=\'activeField address\'" value="' . $res['mobile_number'] . '" />
					</td>
				</tr>
				<tr>
					<td style="width: 170px;"><label for="comment">შენიშვნა: </label></td>
					<td valign="top">
						<textarea id="comment" class="idle large" cols="40" rows="4" style="width: 226px !important;">' . $res['comment'] . '</textarea>
					</td>
				</tr>
			</table>
			<!-- ID -->
			<div id="accordion">
			  <h3>მომხმარებელი</h3>
			  <div>
				<div>
					<div style="width: 170px; display: inline;"><label for="user">მომხმარებელი :</label>
						<input type="text" id="user" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res['username'] . '" style="display: inline; margin-left: 42px;"/>
					</div>
				</div>
				<div style=" margin-top: 2px; ">
					<div style="width: 170px; display: inline;"><label for="user_password">პაროლი :</label>
						<input type="password" id="user_password" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res['user_password'] . '" style="display: inline; margin-left: 84px;"/>
					</div>
				</div>
				<div style=" margin-top: 2px; ">
					<div style="width: 170px; display: inline; margin-top: 5px;"><label for="group_permission">ჯგუფი :</label>
						<select id="group_permission" class="idls" style="display: inline; margin-left: 101px;">' . GetGroupPermission($res['group_id']) . '</select>
					</div>
				</div>
				<div style=" margin-top: 2px; ">
					<button id="add_group" style="outline:none; float: right; margin-right: 20px;">ჯგუფის დამატება</button>
				</div>
			  </div>
			</div>
        </fieldset>
 	    <fieldset>
	    	<legend>ტანამშრომლის სურათი</legend>

	    	<table class="dialog-form-table" width="100%">
	    		<tr>
					<td id="img_colum" colspan="2">
						<img id="upload_img" src="media/uploads/images/worker/' . $image . '">
					</td>
				</tr>
				<tr><!-- Upload Image -->
					<td id="act">
						<span>
							<a href="#" id="view_image" class="complate">View</a> | <a href="#" id="delete_image" class="delete">Delete</a>
						</span>
					</td>
					<td>
						<div class="file-uploader">
							<input id="choose_file" type="file" name="choose_file" class="input" style="display: none;">
							<button id="choose_button" class="center">აირჩიეთ ფაილი</button>
						</div>
					</td>
				</tr>
			</table>
        </fieldset>
		<input type="hidden" id="pers_id" value="' . $res['id'] . '" />
		<input type="hidden" id="is_user" value="' . false . '" />
    </div>
    ';
    return $data;
}
示例#5
0
     if (!error()) {
         $image_url = get_image_url($photo_id, 'l');
         echo json_encode(array('success' => true, 'photo_id' => $photo_id, 'photo_preview' => $image_url));
     } else {
         echo json_encode(array('error' => error()));
     }
     break;
 case "insert_photo":
     /* $_POST['photo_title'] = genTags(str_replace(array('_','-'),' ',$_POST['photo_title']));
     		$_POST['photo_description'] = genTags(str_replace(array('_','-'),' ',$_POST['photo_description']));
     		$_POST['photo_tags'] = genTags(str_replace(array(' ','_','-'),', ',$_POST['photo_tags']));
     		$_POST['server_url'] = mysql_clean($_POST['server_url']);
     		$_POST['folder'] = str_replace('..','',mysql_clean($_POST['folder'])); */
     $name = mysql_clean($_POST['title']);
     $filename = cb_filename();
     $extension = GetExt($name);
     $name = str_replace('.' . $extension, '', $name);
     $photo_dir = createDataFolders(PHOTOS_DIR);
     $post_data = array('photo_title' => $name, 'photo_description' => $name, 'photo_tags' => genTags(str_replace(array(' ', '_', '-'), ', ', $name)), 'filename' => $filename, 'folder' => $photo_dir, 'collection_id' => mysql_clean($_POST['collection']), 'ext' => $extension);
     $insert_id = $cbphoto->insert_photo($post_data);
     if (error()) {
         $response['error'] = error();
     }
     if (msg()) {
         $response['success'] = true;
         $response['id'] = $insert_id;
         $response['file'] = $filename;
         $response['extension'] = $extension;
         $response['file_directory'] = $photo_dir;
     }
     echo json_encode($response);
示例#6
0
 function UploadThumb($flv, $thumbid)
 {
     $file = $_FILES["upload_thumb_{$thumbid}"]['tmp_name'];
     $ext = GetExt($_FILES["upload_thumb_{$thumbid}"]['name']);
     if (!empty($file) && $ext == 'jpg') {
         $image = new ResizeImage();
         if ($image->ValidateImage($file, $ext)) {
             $thumb = BASEDIR . '/files/thumbs/' . GetThumb($flv, $thumbid);
             move_uploaded_file($file, $thumb);
             $image->CreateThumb($thumb, $thumb, THUMB_WIDTH, $ext, THUMB_HEIGHT, false);
             return true;
         } else {
             return false;
         }
     } else {
         return false;
     }
 }
示例#7
0
 /**
  * FUNCTION USED TO GE USER THUMBNAIL
  * @param : thumb file
  * @param : size (NULL,small)
  */
 function getUserThumb($udetails, $size = '', $uid = NULL, $just_file = false)
 {
     $remote = false;
     if (empty($udetails['userid']) && $uid) {
         $udetails = $this->get_user_details($uid);
     }
     //$thumbnail = $udetails['avatar'] ? $udetails['avatar'] : NO_AVATAR;
     $thumbnail = $udetails['avatar'];
     $thumb_file = USER_THUMBS_DIR . '/' . $thumbnail;
     if (file_exists($thumb_file) && $thumbnail) {
         $thumb = USER_THUMBS_URL . '/' . $thumbnail;
     } elseif (!empty($udetails['avatar_url'])) {
         $thumb = $udetails['avatar_url'];
         $remote = true;
     } else {
         if (!USE_GAVATAR) {
             $thumb_file = $this->get_default_thumb();
         } else {
             switch ($size) {
                 case "small":
                     $thesize = AVATAR_SMALL_SIZE;
                     $default = $this->get_default_thumb('small');
                     break;
                 default:
                     $thesize = AVATAR_SIZE;
                     $default = $this->get_default_thumb();
             }
             $email = $udetails['email'];
             $email = $email ? $email : $udetails['anonym_email'];
             $gravatar = new Gravatar($email, $default);
             $gravatar->size = $thesize;
             $gravatar->rating = "G";
             $gravatar->border = "FF0000";
             $thumb = $gravatar->getSrc();
             //echo $gravatar->toHTML();
         }
     }
     $ext = GetExt($thumb_file);
     $file = getName($thumb_file);
     if (!$remote) {
         if (!empty($size) && !$thumb) {
             $thumb = $this->get_default_thumb('small');
         } elseif (!$thumb) {
             $thumb = $this->get_default_thumb();
         }
     }
     if ($just_file) {
         return $file . '.' . $ext;
     }
     return $thumb;
 }
示例#8
0
function playlist_upload_cover($args)
{
    global $db;
    $filename = $args['playlist_id'];
    $extension = GetExt($args['name']);
    $folder = create_dated_folder(PLAYLIST_COVERS_DIR);
    $uploaded_file = PLAYLIST_COVERS_DIR . '/' . $folder . '/' . $filename . '.' . $extension;
    if (!empty($filename)) {
        if (move_uploaded_file($args['tmp_name'], $uploaded_file)) {
            $cover_name = $filename . '.' . $extension;
            $resizer = new CB_Resizer($uploaded_file);
            $resizer->target = $uploaded_file;
            $resizer->resize(1280, 800);
            $resizer->save();
            $db->update(tbl('playlists'), array('cover'), array($folder . '/' . $cover_name), " playlist_id = '" . $filename . "' ");
            return true;
        }
    }
    return false;
}
示例#9
0
    $swfObj->height = $height;
}
//Setting FOr Embed Code
if ($embeded == 'yes') {
    $player = 'embedCode';
}
//Setting Basic Player
if ($player == 'clipbucketblue.swf' || $player == 'youtube.swf' || $player == 'youtube_glossy.swf') {
    $swfObj->playerFile = BASEURL . '/player/' . FLVPLAYER;
    $swfObj->FlashObj();
    //Writing Param
    $swfObj->addParam('allowfullscreen', 'true');
    $swfObj->addParam('allowscriptaccess', 'always');
    $swfObj->addParam('quality', 'high');
    $swfObj->addVar('baseurl', BASEURL);
    $swfObj->addVar('video', $flv);
    if (!empty($flv_url) && GetExt($flv_url) == 'flv') {
        $swfObj->addVar('file_url', urldecode($flv_url));
    } else {
        $swfObj->addVar('file_url', BASEURL . '/files/videos/' . $flv);
    }
    $swfObj->CreatePlayer();
}
//Embed Code
if ($player == 'embedCode') {
    $swfObj->EmbedCode($code);
}
//Including Flv Player Plugin file
include '../includes/flv_player.php';
header("Content-type: text/javascript; charset=utf-8");
print $swfObj->code;
示例#10
0
function ShowGuide($id, $ancestor)
{
    global $last;
    global $name;
    global $editors;
    global $userfiles;
    $query = "SELECT * from guides WHERE id={$id} AND ancestor={$ancestor}";
    $result = mysql_query($query);
    if (!$result) {
        echo mysql_error();
        exit;
    }
    if (mysql_num_rows($result) == 0) {
        print "</TABLE>\n";
        return 0;
        /* end of recursive call */
    }
    $line = mysql_fetch_array($result, MYSQL_ASSOC);
    $num = $line['num'];
    $last = $num;
    $header = $line['header'];
    $contents = $line['contents'];
    $picture = $line['picture'];
    $header = SpecialCodes($header);
    $contents = SpecialCodes($contents);
    if ($ancestor == 0) {
        /* this is first time so start table */
        print "<TABLE dir=RTL border=0 width=100%>\n";
    }
    print "<TR><TD>\n";
    print "<A HREF=javascript:void() onclick=\"blocking('s{$num}', 'h{$num}')\">{$header}</A><BR>\n";
    print "<TR><TD>\n";
    print "<DIV class=para id=s{$num}>\n";
    print "<TABLE dir=RTL width=100%><TR><TD valign=top>\n";
    DisplayContents($contents);
    print "<BR>\n";
    if (!empty($picture)) {
        print "<TD valign=center align=center>\n";
        $ext = GetExt($picture);
        if (IsImg($ext)) {
            $s = getimagesize("{$userfiles}/{$picture}");
            $w = $s[0];
            $ow = $w + 35;
            $h = $s[1];
            $oh = $h + 35;
            if ($w > 100) {
                $ar = $h / $w;
                $h = 200 * $ar;
                $w = 200;
            }
            print "<A HREF=\"#\" onclick=\"javascript:window.open(";
            print "'{$userfiles}/{$picture}', 'Picture', 'height={$oh}, width={$ow} scrollbars=yes resizable=yes')\">";
            print "<IMG SRC={$userfiles}/{$picture} width={$w} height={$h} border=0>";
            print "</A><BR><BR>\n";
        } else {
            print "<TD><A HREF={$userfiles}/{$picture} target=_blank>";
            print "{$l10nstr['189']} ";
            print "{$ext}</A><BR>\n";
        }
    }
    print "</TABLE>\n";
    print "</DIV>\n";
    ShowGuide($id, $num);
}
示例#11
0
$layout_dirs = array();
foreach ($lDirs as $ldir) {
    $dp = @opendir($dir . '/' . $ldir);
    if ($dp) {
        while ($file = readdir($dp)) {
            $ext = GetExt($file);
            if ($ext == 'html' || $ext == 'HTML') {
                $layout_dirs[$ldir]['files'][] = $file;
            }
            if (!strstr($file, '.')) {
                $subdir = $dir . '/' . $ldir . '/' . $file;
                $subdirfiles = array();
                $sdp = @opendir($subdir);
                if ($sdp) {
                    while ($subfile = readdir($sdp)) {
                        $ext = GetExt($subfile);
                        if ($ext == 'html' || $ext == 'HTML') {
                            $subdirfiles[] = $subfile;
                        }
                    }
                }
                closedir($sdp);
                if ($subdirfiles) {
                }
                sort($subdirfiles);
                $layout_dirs[$ldir]['dirs'][$file] = $subdirfiles;
            }
        }
    }
    closedir($dp);
}
示例#12
0
<?php

/*
 * @Author Arslan Hassan
 * @Since 3.0
 * 
 * Newly added Conversion Settings for new conversion kit
 */
require_once '../includes/admin_config.php';
$userquery->admin_login_check();
$userquery->login_check('web_config_access');
if (isset($_POST['profile_id'])) {
    //checking if there is watermark file..
    $file = $_FILES['watermark_file'];
    if ($file['tmp_name']) {
        if (GetExt($file['name']) != 'png') {
            e(lang('Please upload png file only for watermark.'));
        } else {
            $waterMarkFile = WATERMARK_DIR . '/' . $_POST['profile_id'] . '.png';
            if (file_exists($waterMarkFile)) {
                unlink($waterMarkFile);
            }
            if (move_uploaded_file($file['tmp_name'], $waterMarkFile)) {
                //show success watermark msg
            } else {
                e(lang("Unable to upload watermark file"));
            }
        }
    }
    if (!$_POST['updated_profile']) {
        e(lang("Profile has been created"), "m");
示例#13
0
 $line = mysql_fetch_array($result, MYSQL_ASSOC);
 $num = $line['num'];
 $title = $line['title'];
 $contents = $line['contents'];
 $time = $line['time'];
 $pic = $line['pic'];
 print "<CENTER><H1 dir=RTL>{$title}</H1>\n";
 print "</CENTER><P dir=RTL>\n";
 $timestr = GetTimeFromDateTime($time);
 print "{$timestr}<BR>\n";
 print "<P><BR>\n";
 print "<TABLE border=0 width=100% dir=RTL><TR bgcolor=#FFFFFF>\n";
 print "<TD valign=top>\n";
 DisplayContents($contents);
 if (!empty($pic)) {
     $ext = GetExt($pic);
     if (IsImg($ext)) {
         print "<TD>\n";
         DisplayImg($pic);
     } else {
         print "<BR><BR><A HREF=\"{$userfiles}/{$pic}\">{$ext} ";
         print "מצורף קובץ: ";
         print "</A>\n";
     }
 }
 print "<TR><TD>\n";
 if ($user == $name) {
     print "<A HREF=blogmsg.php?action=edit&blog={$blognum}&num={$num}>";
     print "ערוך";
     print "</A>&nbsp;&nbsp;&nbsp;&nbsp;\n";
 }
示例#14
0
 /**
  * FUNCTION USED TO GE USER THUMBNAIL
  * @param : thumb file
  * @param : size (NULL,small)
  */
 function getUserThumb($udetails, $size = '', $uid = NULL, $just_file = false)
 {
     global $Cbucket;
     $remote = false;
     if (empty($udetails['userid']) && $uid) {
         $udetails = $this->get_user_details($uid);
     }
     //$thumbnail = $udetails['avatar'] ? $udetails['avatar'] : NO_AVATAR;
     $thumbnail = $udetails['avatar'];
     $thumb_file = USER_THUMBS_DIR . '/' . $thumbnail;
     if (file_exists($thumb_file) && $thumbnail) {
         $thumb = USER_THUMBS_URL . '/' . $thumbnail;
     } elseif (!empty($udetails['avatar_url'])) {
         $thumb = $udetails['avatar_url'];
         $remote = true;
     } else {
         if (!USE_GAVATAR) {
             $thumb_file = $this->get_default_thumb();
         } else {
             switch ($size) {
                 case "small":
                     $thesize = AVATAR_SMALL_SIZE;
                     $default = $this->get_default_thumb('small');
                     break;
                 default:
                     $thesize = AVATAR_SIZE;
                     $default = $this->get_default_thumb();
             }
             $email = $udetails['email'];
             $email = $email ? $email : $udetails['anonym_email'];
             $gravatar = new Gravatar($email, $default);
             $gravatar->size = $thesize;
             $gravatar->rating = "G";
             $gravatar->border = "FF0000";
             $thumb = $gravatar->getSrc();
             //echo $gravatar->toHTML();
         }
     }
     $ext = GetExt($thumb_file);
     $file = getName($thumb_file);
     if (!$remote) {
         if (!empty($size) && !$thumb) {
             $thumb = USER_THUMBS_URL . '/' . $file . '-' . $size . '.' . $ext;
             $thumb_path = $file . '.' . $ext;
         } elseif (!$thumb) {
             $thumb = USER_THUMBS_URL . '/' . $file . '.' . $ext;
             $thumb_path = "";
         }
     }
     $thumb_name = $file . '.' . $ext;
     if ($just_file) {
         return $file . '.' . $ext;
     }
     if ($size) {
         $params = array('size' => $size, 'thumb_path' => "images/avatars/", 'thumb_name' => $thumb_name, 'just_file' => $just_file, 'is_remote' => $remote);
         if (count($Cbucket->custom_user_thumb) > 0) {
             $functions = $Cbucket->custom_user_thumb;
             foreach ($functions as $func) {
                 if (function_exists($func)) {
                     $func_data = $func($params);
                     if ($func_data) {
                         return $func_data;
                     }
                 }
             }
         }
         return $thumb = USER_THUMBS_URL . '/' . $file . '.' . $ext;
         //return $this->resizer($size,$thumb);
     }
     return $thumb;
 }