コード例 #1
0
ファイル: album.php プロジェクト: martinlindhe/core_dev
     if ($album->owner != 0 && $album->owner != $this->child) {
         throw new \Exception('epic HACK attempt');
     }
     echo '<h1>Photo album ' . $album->name . ' by ' . UserLink::render($this->child) . '</h1>';
     echo 'Created ' . ago($album->time_created) . '<br/>';
     // shows album content
     $images = File::getByCategory(USER, $this->child2, $this->child);
     if (!$images && $album->owner) {
         echo '&raquo; ' . ahref('u/album/delete/' . $this->child2, 'Delete empty album') . '<br/>';
     }
     if ($session->id == $this->child) {
         echo '&raquo; ' . ahref('u/album/upload/' . $this->child2, 'Add photos') . '<br/>';
     }
     foreach ($images as $im) {
         $a = new XhtmlComponentA();
         $a->href = getThumbUrl($im->id, 0, 0);
         $a->rel = 'lightbox[album]';
         $a->content = showThumb($im->id, $im->name, 150, 150);
         echo $a->render();
         echo ahref('u/photo/show/' . $im->id, 'Details');
         echo '<br/><br/>';
     }
     $lb = new YuiLightbox();
     echo $lb->render();
     break;
 case 'delete':
     $session->requireLoggedIn();
     if ($this->child && confirmed('Are you sure you want to delete this photo album?')) {
         // verify that the owner of the album is current session id
         $album = PhotoAlbum::get($this->child);
         if (!$album->owner || $album->owner != $session->id) {
コード例 #2
0
ファイル: search.php プロジェクト: joaotdn/modabiz
                    <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" class="blog-title"><?php the_title(); ?></a>
                </h2>

                <nav class="share-footer show-for-large-up text-center">
                    <ul class="inline-list d-iblock no-margin">
                        <li><div class="fb-like" data-layout="button_count" data-href="<?php the_permalink(); ?>"></div></li>
                        <li><a class="twitter-share-button" href="https://twitter.com/intent/tweet?url=<?php the_permalink(); ?>">Tweet</a></li>
                        <li><div class="g-plusone" data-size="medium" data-width="65" data-href="<?php the_permalink();?>"></div></li>
                        <li><div class="fb-share-button" data-href="<?php the_permalink(); ?>" data-layout="button"></div></li>
                    </ul>
                    <div class="divide-20"></div>
                </nav>

                <figure class="divide-20 post-th">
                    <?php
                        $thumb = getThumbUrl('large',$post->ID);
                        $video = get_field('post_video');
                        $link = get_permalink($post->ID);
                        if(!empty($thumb) || !empty($video)) {
                            if(!empty($video))
                                echo '<div class="flex-video no-margin">' . $video . '</div>';
                            else
                                echo "<a href=\"{$link}\"><img src=\"{$thumb}\" class=\"small-12 left\"></a>";
                        }
                    ?>
                </figure>

                <h5 class="divide-20 d-block post-author text-center text-up">Por: <?php echo the_author_meta( 'first_name' ); ?></h5>
                
                <?php
                    if(get_the_tags()):
コード例 #3
0
ファイル: Image.php プロジェクト: martinlindhe/core_dev
function showThumb($id, $title = '', $w = 50, $h = 50)
{
    $i = new XhtmlComponentImage();
    $i->src = getThumbUrl($id, $w, $h);
    $i->alt = strip_tags($title);
    $i->title = strip_tags($title);
    return $i->render();
}
コード例 #4
0
ファイル: feed-entry.php プロジェクト: diegomtzb/cmg
<article class="entry">
    <div style="width: 250px; overflow: hidden; float: left;">
        <figure class="pull-right entryFigure">
            <img src="<?php 
echo getThumbUrl('newsFeed');
?>
"/>
        </figure>
    </div>
    <div class="col-lg-8 pull-right">
        <h2 class="entryTitle"><?php 
echo get_the_title();
?>
</h2>
        <p>
            <?php 
echo get_the_excerpt();
?>
        </p>
        <a href="<?php 
echo get_permalink();
?>
" class="readMore">Leer más</a>
    </div>
</article>
<div class="spaceBar"></div>
コード例 #5
0
ファイル: functions.php プロジェクト: plandd/pbagora
function fb_opengraph()
{
    global $post;
    $thumb = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'destaque.pequeno');
    $th = !empty($thumb[0]) ? $thumb[0] : '';
    $site_description = get_bloginfo('description');
    $stylesheet_url = get_bloginfo('stylesheet_url');
    $stylesheet_directory = get_bloginfo('stylesheet_directory');
    $site_name = is_home() ? get_bloginfo('name') : get_the_title($post->ID);
    $site_url = is_home() ? get_bloginfo('siteurl') : get_permalink($post->ID);
    $keywords = get_field('pba_keywords', 'option');
    ?>

    <meta name="description" content="<?php 
    echo getPageDescription();
    ?>
">
    <meta name="keywords" content="<?php 
    echo $keywords;
    ?>
">
    <meta name="author" content="http://plandc.com.br">
    <meta name="subject" content="Portal de notícias da Paraíba">

    <title><?php 
    bloginfo('name');
    ?>
 | <?php 
    is_home() ? bloginfo('description') : wp_title('');
    ?>
</title>
    <link rel="shortcut icon" href="<?php 
    echo $stylesheet_directory;
    ?>
/favicon.ico" type="image/vnd.microsoft.icon"/>
    <link rel="icon" href="<?php 
    echo $stylesheet_directory;
    ?>
/favicon.ico" type="image/x-ico"/>
    <link rel="stylesheet" href="<?php 
    echo $stylesheet_url;
    ?>
" />

    <!-- Schema.org markup for Google+ -->
    <meta itemprop="name" content="<?php 
    echo $site_name;
    ?>
">
    <meta itemprop="description" content="<?php 
    echo getPageDescription();
    ?>
">
    <?php 
    if (is_home()) {
        ?>
      <meta itemprop="image" content="<?php 
        echo $stylesheet_directory;
        ?>
/screenshot.png">
    <?php 
    } else {
        ?>
<meta itemprop="image" content="<?php 
        getThumbUrl('full');
        ?>
"><?php 
    }
    ?>

    <!-- Twitter Card data -->
    <?php 
    if (is_home()) {
        ?>
      <meta name="twitter:card" content="<?php 
        echo $stylesheet_directory;
        ?>
/screenshot.png">
    <?php 
    } else {
        ?>
<meta name="twitter:card" content="<?php 
        getThumbUrl('full');
        ?>
"><?php 
    }
    ?>
    <meta name="twitter:site" content="@pbagora">
    <meta name="twitter:title" content="<?php 
    echo $site_name;
    ?>
">
    <meta name="twitter:description" content="<?php 
    echo getPageDescription();
    ?>
">
    <meta name="twitter:creator" content="@plandc">
    <!-- Twitter summary card with large image must be at least 280x150px -->
    <?php 
    if (is_home()) {
        ?>
      <meta name="twitter:image:src" content="<?php 
        echo $stylesheet_directory;
        ?>
/screenshot.png">
    <?php 
    } else {
        ?>
<meta name="twitter:image:src" content="<?php 
        getThumbUrl('full');
        ?>
"><?php 
    }
    ?>

    <!-- Open Graph data -->
    <meta property="og:title" content="<?php 
    echo $site_name;
    ?>
" />
    <meta property="og:type" content="article" />
    <meta property="og:url" content="<?php 
    echo $site_url;
    ?>
" />
    <?php 
    if (is_home()) {
        ?>
      <meta property="og:image" content="<?php 
        echo $stylesheet_directory;
        ?>
/screenshot.png" />
    <?php 
    } else {
        ?>
<meta property="og:image" content="<?php 
        getThumbUrl('full');
        ?>
" /><?php 
    }
    ?>
    <meta property="og:description" content="<?php 
    echo getPageDescription();
    ?>
" />
    <meta property="og:site_name" content="<?php 
    echo $site_name;
    ?>
" />
    
    <?php 
    if (!is_home()) {
        ?>
      <meta property="article:section" content="Artigo" />
      <meta property="article:tag" content="<?php 
        echo $keywords;
        ?>
" />
    <?php 
    }
    ?>
 
<?php 
    echo get_field('pba_analytics', 'option');
}
コード例 #6
0
ファイル: userdata.php プロジェクト: martinlindhe/core_dev
        $form->addInput('label', 'Label', $field->label);
        $form->addDropdown('type', 'Type', UserDataField::getTypes(), $field->type);
        switch ($field->type) {
            case UserDataField::RADIO:
                for ($i = 1; $i < 6; $i++) {
                    $opt = 'opt_' . $i;
                    $val = UserDataFieldOption::get($field->id, $opt);
                    $form->addInput($opt, 'Option ' . $i, $val);
                }
                break;
            case UserDataField::AVATAR:
                for ($i = 1; $i < 6; $i++) {
                    $opt = 'avatar_' . $i;
                    $val = UserDataFieldOption::get($field->id, $opt);
                    if ($val) {
                        $img = new XhtmlComponentImage();
                        $img->src = getThumbUrl($val);
                        $form->add($img, 'Existing picture ' . $i);
                        //                $form->addCheckbox('remove_'.$f->id, 'Remove photo');
                    }
                    $form->addFile($opt, 'Avatar ' . $i, $val);
                }
                break;
        }
        $form->addSubmit('Save');
        $form->setHandler('editSubmit');
        echo $form->render();
        break;
    default:
        echo 'No handler for view ' . $this->owner;
}
コード例 #7
0
ファイル: functions.php プロジェクト: plandd/sergiomatos
function fb_opengraph()
{
    global $post;
    $thumb = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'destaque.pequeno');
    $th = !empty($thumb[0]) ? $thumb[0] : '';
    $site_description = get_bloginfo('description');
    $stylesheet_url = get_bloginfo('stylesheet_url');
    $stylesheet_directory = get_bloginfo('stylesheet_directory');
    $site_name = is_home() ? get_bloginfo('name') : get_the_title($post->ID);
    $site_url = is_home() ? get_bloginfo('siteurl') : get_permalink($post->ID);
    $keywords = 'produtos, design, desenho industrial';
    ?>

    <meta name="description" content="<?php 
    echo getPageDescription();
    ?>
">
    <meta name="keywords" content="<?php 
    echo $keywords;
    ?>
">
    <meta name="author" content="<?php 
    echo $site_url;
    ?>
">
    <meta name="subject" content="Sérgio J. Matos">

    <!-- Schema.org markup for Google+ -->
    <meta itemprop="name" content="<?php 
    echo $site_name;
    ?>
">
    <meta itemprop="description" content="<?php 
    echo getPageDescription();
    ?>
">
    <?php 
    if (is_home()) {
        ?>
      <meta itemprop="image" content="<?php 
        echo $stylesheet_directory;
        ?>
/screenshot.png">
    <?php 
    } else {
        ?>
<meta itemprop="image" content="<?php 
        getThumbUrl();
        ?>
"><?php 
    }
    ?>

    <!-- Twitter Card data -->
    <?php 
    if (is_home()) {
        ?>
      <meta name="twitter:card" content="<?php 
        echo $stylesheet_directory;
        ?>
/screenshot.png">
    <?php 
    } else {
        ?>
<meta name="twitter:card" content="<?php 
        getThumbUrl();
        ?>
"><?php 
    }
    ?>
    <meta name="twitter:site" content="@sergiojmatos">
    <meta name="twitter:title" content="<?php 
    echo $site_name;
    ?>
">
    <meta name="twitter:description" content="<?php 
    echo getPageDescription();
    ?>
">
    <meta name="twitter:creator" content="@sergiojmatos">
    <!-- Twitter summary card with large image must be at least 280x150px -->
    <?php 
    if (is_home()) {
        ?>
      <meta name="twitter:image:src" content="<?php 
        echo $stylesheet_directory;
        ?>
/screenshot.png">
    <?php 
    } else {
        ?>
<meta name="twitter:image:src" content="<?php 
        getThumbUrl();
        ?>
"><?php 
    }
    ?>

    <!-- Open Graph data -->
    <meta property="og:title" content="<?php 
    echo $site_name;
    ?>
" />
    <meta property="og:type" content="article" />
    <meta property="og:url" content="<?php 
    echo $site_url;
    ?>
" />
    <?php 
    if (is_home()) {
        ?>
      <meta property="og:image" content="<?php 
        echo $stylesheet_directory;
        ?>
/screenshot.png" />
    <?php 
    } else {
        ?>
<meta property="og:image" content="<?php 
        getThumbUrl();
        ?>
" /><?php 
    }
    ?>
    <meta property="og:description" content="<?php 
    echo getPageDescription();
    ?>
" />
    <meta property="og:site_name" content="<?php 
    echo $site_name;
    ?>
" />
    
    <?php 
    if (!is_home()) {
        ?>
      <meta property="article:section" content="Artigo" />
      <meta property="article:tag" content="<?php 
        echo $keywords;
        ?>
" />
    <?php 
    }
    ?>
 
<?php 
    echo get_field('pba_analytics', 'option');
}
コード例 #8
0
ファイル: edit.php プロジェクト: martinlindhe/core_dev
             break;
         case UserDataField::AVATAR:
             $opts = UserDataFieldOption::getAll($f->id);
             $arr = array();
             foreach ($opts as $o) {
                 $img = new XhtmlComponentImage();
                 $img->src = getThumbUrl($o['value']);
                 $arr[$o['id']] = $img->render();
             }
             $form->addRadio($f->name, $f->label, $arr, UserSetting::get($session->id, $f->name));
             break;
         case UserDataField::IMAGE:
             $pic_id = UserSetting::get($session->id, 'picture');
             if ($pic_id) {
                 $img = new XhtmlComponentImage();
                 $img->src = getThumbUrl($pic_id);
                 $form->add($img, 'Existing picture');
                 $form->addCheckbox('remove_' . $f->id, 'Remove photo');
             }
             $form->addFile($f->name, $f->label);
             break;
         case UserDataField::CHECKBOX:
             $form->addCheckbox($f->name, $f->label, UserSetting::get($session->id, $f->name));
             break;
         default:
             $form->addInput($f->name, $f->label, UserSetting::get($session->id, $f->name));
     }
 }
 $form->addSubmit('Save');
 $form->setHandler('handleEdit');
 echo $form->render();
コード例 #9
0
ファイル: tooltip.php プロジェクト: martinlindhe/core_dev
        echo 'User level: ' . UserHandler::getUserLevel($user_id) . '<br/>';
        $gender_id = UserSetting::get($user_id, 'gender');
        $gender = Setting::getById(USERDATA_OPTION, $gender_id);
        echo 'Gender: ' . $gender . '<br/>';
        $pres = UserSetting::get($user_id, 'presentation');
        if ($pres) {
            echo 'Presentation: ' . $pres . '<br/>';
        }
        $pic_id = UserSetting::get($user_id, 'picture');
        if ($pic_id) {
            echo 'Profile picture:<br/>';
            $a = new XhtmlComponentA();
            $a->href = getThumbUrl($pic_id, 0, 0);
            $a->content = showThumb($pic_id, 'Profilbild', 150, 150);
            echo $a->render();
        } else {
            $avatar_opt = UserSetting::get($user_id, 'avatar');
            // get pic id from avatar_id
            $avatar_id = UserDataFieldOption::getById($avatar_opt);
            if ($avatar_id) {
                echo 'Avatar:<br/>';
                $a = new XhtmlComponentA();
                $a->href = getThumbUrl($avatar_id, 0, 0);
                $a->content = showThumb($avatar_id, 'Avatar', 150, 150);
                echo $a->render();
            }
        }
        break;
    default:
        echo 'No handler for view ' . $this->owner;
}
コード例 #10
0
ファイル: query.php プロジェクト: Tschaul/waka
                 if (strpos($_REQUEST['location'], 'post') == 0) {
                     $id = substr($_REQUEST['location'], 5);
                     $postcount = count($waka['posts']);
                     for ($p = 0; $p < $postcount; $p++) {
                         if ($waka['posts'][$p]['id'] == $id && userMayEdit($waka['users'][$_REQUEST['u']]['email'], $waka['posts'][$p]['users'])) {
                             $item =& $waka['posts'][$p];
                         }
                     }
                 }
             }
         }
         $fcount = count($item['images']);
         for ($f = 0; $f < $fcount; $f++) {
             if ($item['images'][$f]['id'] == $_REQUEST['iid']) {
                 unlink($item['images'][$f]['url']);
                 unlink(getThumbUrl($item['images'][$f]['url']));
                 unlink(getMidsizeUrl($item['images'][$f]['url']));
                 unlink(dirname($item['images'][$f]['url']));
                 array_splice($item['images'], $f, 1);
                 $item['dateImagesTouched'] = date("Y-m-d H:i:s");
             }
         }
     }
 }
 //echo $_REQUEST['location'];
 if ($waka['users'][$_REQUEST['u']]['type'] == 'editor' || $waka['users'][$_REQUEST['u']]['type'] == 'subscriber') {
     if (isset($_REQUEST['action']) && isset($_REQUEST['location']) && strpos($_REQUEST['location'], 'post') == 0) {
         $notify = false;
         /*
         if($_REQUEST['location']=="starter") $item=&$waka['starter'];
         			else if($_REQUEST['location']=="draft"){ 
コード例 #11
0
ファイル: renderHelper.php プロジェクト: Tschaul/waka
function renderItemImagesForm($item, $location)
{
    $str = '';
    $icount = count($item['images']);
    for ($i = 0; $i < $icount; $i++) {
        $str .= '<span class="image"><small><a class="fancy" href="' . $item['images'][$i]['url'] . '"><img src="' . getThumbUrl($item['images'][$i]['url']) . '"></a>';
        $str .= '<span style="vertical-align:top; display:inline-block;"><a class="handle" href="javascript:queryDeleteImage(\'' . $_REQUEST['w'] . '\',\'' . $_REQUEST['u'] . '\',\'' . $location . '\',\'' . $item['images'][$i]['id'] . '\')">';
        $str .= '<img src="img/Actions-edit-delete-icon.png"></a><br><a class="handle" href="javascript:copyToClipboard(\'[image_' . $item['images'][$i]['id'] . ']\')"><img src="img/Actions-edit-copy-icon-1.png"></a></span>';
        $str .= '</small></span>';
    }
    $str .= '<form action="query.php" method="post" enctype="multipart/form-data" class="uploader" autocomplete="off">
		<small>Image upload:</small>  
		<input type="file" name="uploaded">
		<input type="hidden" name="w" value="' . $_REQUEST['w'] . '">
		<input type="hidden" name="u" value="' . $_REQUEST['u'] . '">
		<input type="hidden" name="uploadType" value="image">
		<input type="hidden" name="location" value="' . $location . '">
		<input type="submit" value="Upload">
		</form>';
    return $str;
}