function getBlogData($marketName)
{
    //create client
    $consumerKey = "Add your Key";
    $consumerSecret = "Add Secret key";
    $blogName = 'yr_username.tumblr.com';
    $client = new Tumblr\API\Client($consumerKey, $consumerSecret);
    $response = $client->getBlogPosts($blogName, array('tag' => $marketName));
    // get posts
    $posts = $response->posts;
    $blogs = $response->blog;
    global $dataId;
    $x = 0;
    foreach ($posts as $post) {
        if (isset($post->title)) {
            if (isset($post->body)) {
                $dataArray[] = array('imageSrc' => getImgSrc($post->body, "<img", "/>"), 'title' => $post->title, 'tags' => convertTagsIntoString(array_map('strval', $post->tags)), 'description' => trimblanklines(trimblankspaces(shortenedDescription(getDescription($post->body, "</p>", $dataId), 250))), 'postId' => $post->id);
            }
        }
        $x++;
    }
    return $dataArray;
}
 function displayUploadForm($aImages)
 {
     if (!$aImages) {
         return false;
     }
     $tablePre = "\n\n<!-- BEGIN UploadForm -->\n";
     $tablePre .= "<table border=\"0\" cellspacing=\"1\" cellpadding=\"3\" width=\"100%\">\n";
     $displayed = '';
     for ($i = 0; $i < count($aImages); $i++) {
         $displayed .= "<tr><td style=\"font-size:8px;\">&nbsp;</td></tr><tr><td colspan=\"3\" style=\"background:black;color:white;font-weight:bold;\">Bild " . ($i + 1) . "</td></tr><tr>\n";
         if (isset($aImages[$i])) {
             $image =& $aImages[$i];
             $src = getImgSrc(array("filename" => $image, "imgTag" => imgTagThumb, "type" => 'article'));
             $displayed .= "\r\n\t\t\t\t\t<td valign=\"middle\" align=\"center\" class=TableElement><img src='{$src}' alt=\"{$image->title_de}\"></td>\r\n\t\t\t\t\t<td valign=\"top\">\r\n\t\t\t\t\t\tBilddatei <br /><input type=text name=files[File{$i}][name] value ='{$image->filename}' size=\"36\" maxlength=255><br />\r\n\t\t\t\t\t\tBild Tooltip<br />\r\n\t\t\t\t\t\t<img src=\"../../images/flag_de.gif\" width=\"20\" height=\"12\">&nbsp;<input type=text name=files[File{$i}][title_de] value ='{$image->title_de}' size=\"32\" maxlength=50><br />\r\n\t\t\t\t\t\t<img src=\"../../images/flag_en.gif\" width=\"20\" height=\"12\">&nbsp;<input type=text name=files[File{$i}][title_en] value ='{$image->title_en}' size=\"32\" maxlength=50><br />\r\n\t\t\t\t\t</td>\r\n\t\t\t\t\t<td valign=\"top\" >L&ouml;schen<br><input type=checkbox name=files[File{$i}][delete] > </td>\r\n\t\t\t\t\t";
         } else {
             $displayed .= "<td colspan=\"3\"><input type=\"file\" name=\"File{$i}\" length=\"27\"></td>\n";
         }
         $displayed .= "</tr>\n";
     }
     // for
     $tableSuf = "</table> \n";
     $tableSuf .= "<!-- END UploadForm -->\n";
     return $tablePre . $displayed . $tableSuf;
 }
示例#3
0
						<div class="testimonial-image" style="width: 50px; margin: 0 auto; margin-top: 12px;">
							<img class="img-circle" style="" src="<?php 
echo getImgSrc($_SESSION['user']->u_profile_photo, 'profile');
?>
" />
						</div>													
					</li>
					<!-- mega-menu end -->
					<!-- mega-menu start -->													
					<li class="dropdown">
						<!-- header dropdown buttons 
						<div class="header-dropdown-buttons">
							<div class="btn-group">
								<button type="button" class="btn">
									<img class="img-circle" style="padding: 1px; border:1px solid #fff;;" src="<?php 
echo getImgSrc($_SESSION['user']->u_profile_photo, 'profile');
?>
" />
								</button>
																
							</div>												
						</div>
						<!-- header dropdown buttons end-->
						<a class="dropdown-toggle" data-toggle="dropdown" href="#"><?php 
echo $_SESSION['user']->u_firstname . ' ' . $_SESSION['user']->u_lastname;
?>
</a>
						<ul class="dropdown-menu">
							<li ><a href="account.php?redirect=edit-my-info">Edit My Info</a></li>
							<li ><a href="account.php?redirect=change-password">Change Password</a></li>
							<li ><a href="account.php?redirect=change-profile-photo">Change Profile Photo</a></li>
示例#4
0
文件: profile.php 项目: bunver/odiet
													<!--<img class="img-responsive img-rounded" src="' . $getImgSrc . '" />-->
												</div>	
												<div class="panel-body" style="border-top:1px solid #bce8f1;">
													' . $getRefStatusShare->us_text . '
												</div>
												<!-- /Body -->	
												<div class="panel-footer">
													<small>' . $getRefStatusShare->displayDate . ' (' . $date . ')</small>
												</div>	
											</article>';
            break;
        case 'u_shared_photo':
            $getRefStatusShare = getRefStatusShare($value['ref_id'], $value['u_id']);
            $date = date_create($getRefStatusShare->us_date);
            $date = date_format($date, 'm-d-Y');
            $getImgSrc = getImgSrc($getRefStatusShare->p_id, 'status');
            $view .= '<article class="panel panel-primary">						
												<!-- Icon -->
												<div class="panel-heading icon">
													<i class="fa fa-picture-o"></i>
												</div>
												<!-- /Icon -->
										
												<!-- Heading -->
												<div class="panel-heading">
													<h2 class="panel-title">Status Updated</h2>
												</div>
												<!-- /Heading -->
										
												<!-- Body -->
												<div class="panel-body">
示例#5
0
/**
 * Функция обработки тэгов полей с использованием шаблонов
 * в соответствии с типом поля
 *
 * @param int $rubric_id	идентификатор рубрики
 * @param int $document_id	идентификатор документа
 * @param int $maxlength	максимальное количество символов обрабатываемого поля
 * @return string
 */
function request_get_document_field($rubric_id, $document_id, $maxlength = '')
{
    if (!is_numeric($document_id) || $document_id < 1) {
        return '';
    }
    $document_fields = get_document_fields($document_id);
    if (!is_array($document_fields[$rubric_id])) {
        $rubric_id = intval($document_fields[$rubric_id]);
    }
    if (empty($document_fields[$rubric_id])) {
        return '';
    }
    $field_value = trim($document_fields[$rubric_id]['field_value']);
    if ($field_value == '' && $document_fields[$rubric_id]['tpl_req_empty']) {
        return '';
    }
    $func = 'get_field_' . $document_fields[$rubric_id]['rubric_field_type'];
    if (is_callable($func)) {
        $field_value = $func($field_value, 'req', "", "", "", $maxlength, $document_fields, $rubric_id);
    } else {
        $field_value = get_field_default($field_value, 'req', "", "", "", $maxlength, $document_fields, $rubric_id);
    }
    if ($maxlength != '') {
        if ($maxlength == 'more' || $maxlength == 'esc' || $maxlength == 'img') {
            if ($maxlength == 'more') {
                //$teaser = explode('<a name="more"></a>', $field_value);
                $teaser = explode('<hr />', $field_value);
                $field_value = $teaser[0];
            } elseif ($maxlength == 'esc') {
                $field_value = addslashes($field_value);
            } elseif ($maxlength == 'img') {
                $field_value = getImgSrc($field_value);
            }
        } elseif (is_numeric($maxlength)) {
            if ($maxlength < 0) {
                $field_value = str_replace(array("\r\n", "\n", "\r"), " ", $field_value);
                $field_value = strip_tags($field_value, "<a>");
                $field_value = preg_replace('/  +/', ' ', $field_value);
                $field_value = trim($field_value);
                $maxlength = abs($maxlength);
            }
            if ($maxlength != 0) {
                $field_value = mb_substr($field_value, 0, $maxlength) . (strlen($field_value) > $maxlength ? '... ' : '');
            }
        } else {
            return false;
        }
    }
    return $field_value;
}