Ejemplo n.º 1
0
function pd_is_archived($post_id, $field = NULL)
{
    // check if there are any custom fields
    $meta = get_post_custom($post_id);
    if ($meta) {
        if (isset($meta['_cp_id'])) {
            $meta['_cp_id'] = get_cp_id($meta['_cp_id']);
        }
        if (isset($meta['_author'])) {
            $meta['_author'] = get_author($meta['_author']);
        }
        if (isset($meta['_author_position'])) {
            $meta['_author_position'] = get_author_position($meta['_author_position']);
        }
        if (isset($meta['_image1'])) {
            $meta['_image1'] = get_image($meta['_image1']);
        }
        if (isset($meta['_legacy_id'])) {
            $meta['_legacy_id'] = get_legacy_id($meta['_legacy_id']);
        }
        if ($field == '_image1') {
            return $meta['_image1'];
        }
        if ($field == '_author') {
            if (isset($meta['_author'])) {
                return $meta['_author'];
            }
            return false;
        }
        return $meta;
    }
    // the article is not from the archives
    return false;
}
Ejemplo n.º 2
0
                                                                                                                echo get_form_security();
                                                                                                                echo <<<html
</form>
html;
                                                                                                                $file = get_ordered_toc();
                                                                                                                $unvalidated_list = array();
                                                                                                                $articles = array();
                                                                                                                foreach ($file as $value) {
                                                                                                                    $toc = get_line_data('news_toc', $value);
                                                                                                                    if (!file_exists(FNEWS_ROOT_PATH . 'news/news.' . $toc['news_id'] . '.php')) {
                                                                                                                        continue;
                                                                                                                    }
                                                                                                                    $news_file = file(FNEWS_ROOT_PATH . 'news/news.' . $toc['news_id'] . '.php');
                                                                                                                    array_shift($news_file);
                                                                                                                    $article = get_line_data('news', $news_file[0]);
                                                                                                                    $writer = get_author($toc['author']);
                                                                                                                    $articles[] = array('numcomments' => $article['numcomments'], 'news_id' => $toc['news_id'], 'headline' => $toc['headline'], 'writer' => $writer === false ? $toc['author'] : $writer['nick'], 'date' => date('Y-m-d H:i:s T', $toc['timestamp']));
                                                                                                                    if (sizeof($news_file) <= 1) {
                                                                                                                        // There are no comments (<= 1 because we still count the news line) at all.
                                                                                                                        continue;
                                                                                                                    }
                                                                                                                    // Get a list of unvalidated comments.
                                                                                                                    array_shift($news_file);
                                                                                                                    $comments = array();
                                                                                                                    foreach ($news_file as $v2) {
                                                                                                                        $comment = get_line_data('comments', $v2);
                                                                                                                        if ($comment['validated'] == 0) {
                                                                                                                            $comments[] = $comment;
                                                                                                                        }
                                                                                                                    }
                                                                                                                    if (sizeof($comments) > 0) {
Ejemplo n.º 3
0
    ?>
">
                <h3><?php 
    echo $opn->title;
    ?>
</h3>
            </a>

            <p>
                <?php 
    echo render_teaser($opn, 90);
    ?>
                ...
            </p>
            <?php 
    $a = get_author($opn);
    ?>
            <div class="author">
                <img class="a-img" src="<?php 
    echo $a->image;
    ?>
" alt="">

                <div class="a-info">
                    <div class="a-name">
                        <a href="<?php 
    echo render_href($a->nid);
    ?>
">
                            <?php 
    echo $a->title;
Ejemplo n.º 4
0
    $toc = get_line_data('news_toc', $newsdata);
    $categories = explode(',', $toc['categories']);
    if ($fn_category !== 0 && !in_array($fn_category, $categories)) {
        continue;
    }
    if (!file_exists(FNEWS_ROOT_PATH . 'news/news.' . $toc['news_id'] . '.php')) {
        continue;
    }
    if ($count > 25) {
        break;
    }
    ++$count;
    $news_file = file(FNEWS_ROOT_PATH . 'news/news.' . $toc['news_id'] . '.php');
    $article = get_line_data('news', $news_file[1]);
    $news_info = parse_news_to_view($article, $settings);
    $writer = get_author($article['author']);
    $news_info['date'] = date('r', $article['timestamp']);
    $author = $news_info['email'] ? "\n\t\t" . '<author>' . $news_info['email'] . ' (' . htmlspecialchars($writer['nick']) . ')</author>' . "\n" : '';
    $description = $news_info['description'];
    if ($news_info['description'] == '') {
        $lines = explode("\n", $news_info['news']);
        $description = array_shift($lines);
    }
    ?>
	<item>
		<title><?php 
    echo htmlspecialchars($news_info['subject']);
    ?>
</title>
		<link><?php 
    echo $furl . '/fullnews.php?fn_id=' . $article['news_id'];
Ejemplo n.º 5
0
if (!$database->has("authors", array("id" => $author_id))) {
    header("Location: " . main_url . "/404");
    exit;
}
foreach ($vars as $var) {
    if (strpos($var, 'p:') === 0) {
        $page_no_var = $var;
        //get the current Page from URL
    }
}
//--PAGINATION--//
$perpage = poems_by_author_per_page;
$paginate = paginate($perpage, $page_no_var);
$next_number = $paginate['next_number'];
//--get author informations--//
$author = get_author($database, $author_id);
$tpl->author_info = $author;
//--increment of author views--//
$update_poet = author_view_increment($database, $author_id);
//--get all poems of author--//
$page_poems = get_author_poems($database, $author_id, ['LIMIT' => array($next_number, $perpage), 'COUNT' => true]);
$tpl->page_poems = $page_poems['data'];
$count_records = $page_poems['count'];
$total_pages = ceil($count_records / $perpage);
$current_count = count($page_poems['data']);
$page_array = array();
$page_array['current_page'] = $paginate['page_no'];
$page_array['total_pages'] = $total_pages;
$page_array['total_records'] = $count_records;
$page_array['current_count'] = $current_count;
$page_array['param_vars'] = $vars;
Ejemplo n.º 6
0
echo base_path() . path_to_theme();
?>
/temp/side-ad.jpg" alt="">
            </div>

        </div>
        <div class="second">

            <div class="w-full one-cell pagediv">
                <div class="pageitem">
                <?php 
foreach ($nodes as $key => $nod) {
    ?>
                <article>
                    <?php 
    $a = get_author($nodes[$key]);
    ?>
                    <div class="author">
                        <a href="<?php 
    echo render_href($a->nid);
    ?>
">
                        <img class="a-img" src="<?php 
    echo $a->image;
    ?>
" alt="">
                        </a>

                        <div class="a-info">
                            <div class="a-name">
                                <a href="<?php 
Ejemplo n.º 7
0
                <div id="instafeed"></div>

            </section>

        </aside>

        <article class="article-actualite col-10 col-m-5 col-offset-1">  

            <h2 class="titre-blog">Carnet de voyage</h2>              

            <?php 
$articles = get_articles();
foreach ($articles as $article) {
    $thumbnail = get_thumbnail($article['ID']);
    $author = get_author($article['post_author']);
    ?>
            

            <section class="article-blog col-m-12">

                <div class="row">

                        <div class="thumbnail col-m-4">

                            <?php 
    if ($thumbnail['guid']) {
        ?>
                    
                            <img src="<?php 
        echo $thumbnail['guid'];
Ejemplo n.º 8
0
function themearticle($aid, $informant, $datetime, $title, $thetext, $topic, $topicname, $topicimage, $topictext)
{
    global $admin, $sid, $tipath, $mainindex;
    $posted = _POSTEDON . " {$datetime} " . _BY . " " . get_author($aid);
    if ($notes != "") {
        $notes = "<br><br><b>" . _NOTE . "</b> <i>{$notes}</i>\n";
    }
    if ($aid == $informant) {
        $content = "{$thetext}{$notes}\n";
    } else {
        if ($informant != "") {
            $content = '<a href="' . getlink("Your_Account&amp;op=userinfo&amp;username={$informant}") . "\">{$informant}</a> ";
        } else {
            $content = "{$anonymous} ";
        }
        $content .= _WRITES . " <i>\"{$thetext}\"</i>{$notes}\n";
    }
    $thefile = implode("", file("themes/MP3Tunes/story_page.html"));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"" . $thefile . "\";";
    eval($thefile);
    print $r_file;
}
Ejemplo n.º 9
0
        $tpl->saved_poems = $get_saved_poems;
    }
    //--get saved poets--//
    if (!empty($get_saved_poets)) {
        foreach ($get_saved_poets as $k => $poet_id) {
            $get_saved_poets[$k] = get_author($database, $poet_id);
        }
        $tpl->saved_poets = $get_saved_poets;
    }
    //--get saved users--//
    if (!empty($get_saved_user)) {
        foreach ($get_saved_user as $k => $poet_id) {
            $data = get_user_info($database, $poet_id);
            $get_saved_user[$k] = $data[0];
        }
        $tpl->saved_users = $get_saved_user;
    }
    //--get saved poets--//
    if (!empty($get_user_added_function)) {
        foreach ($get_user_added_function as $k => $poet_id) {
            $get_saved_poets[$k] = get_author($database, $poet_id);
        }
        $tpl->saved_poets = $get_saved_poets;
    }
    $get_active_function = get_function($database, $user_id);
    $get_inactive_function = get_inactive_function($database, $user_id);
    $tpl->my_function = array_merge_recursive($get_active_function, $get_inactive_function);
} else {
    header("location: " . main_url);
}
echo $tpl->render("themes/site/" . theme_name . "/html/mystuff.php");
            ?>
">
                                    <h3><?php 
            echo $nodes[$i]->title;
            ?>
</h3>
                                </a>

                                <p>
                                    <?php 
            echo render_teaser($nodes[$i], 90);
            ?>
                                    ...
                                </p>
                                <?php 
            $a = get_author($nodes[$i]);
            ?>
                                <div class="author">
                                    <img class="a-img" src="<?php 
            echo $a->image;
            ?>
" alt="">

                                    <div class="a-info">
                                        <div class="a-name">
                                            <?php 
            echo $a->title;
            ?>
                                        </div>
                                        <div class="a-title">
                                            <?php 
Ejemplo n.º 11
0
     //$errors .= '<hr><font size="3">'. htmlspecialchars($wgs) .'</font><hr> ';
     //$errors .= '<font size="3">'. $wgses[0] .$wgses[1] .$wgses[2] .'</font><hr>';
     //$errors .= '<font size="3">lat='. $lat . ' lon=' .$lon .'</font><hr>';
 }
 // время
 if (!$geo_date) {
     get_date($line);
     if ($date_t) {
         //$errors .= '<font size="3">'. $date_t .'</font><hr>';
         $geo_date = $date_t;
     }
     $date_t = '';
 }
 if ($first_line == true) {
     // автор
     get_author($line);
     $author = substr($author, 1, -1);
     //$errors .= '<font size="3">'. $author .'</font><hr>';
     // название
     get_name($line);
     //$errors .= '<font size="3">'. $nameg .'</font><hr>';
     // тип
     get_type($line);
     //$errors .= '<font size="3">'. $type .'</font><hr>';
 }
 $first_line = false;
 find_me('<body>', $line);
 //если результат, то данные из следующей линии
 $first_line = $find_res == false ? false : true;
 /*$geo_class = 
 		
Ejemplo n.º 12
0
            $h[4] = "";
            // remove the PHP-statement part because of troubles with ' and "
            $attrib_h = implode("|", $h);
            break;
        default:
            $bgcolor = "dedede";
            $act = true;
            break;
    }
    start_row("style='background-color:#{$bgcolor};'");
    echo "<td style='width;0px;display:none;'>\n";
    start_form(false, false, "repgen_select.php", "edit" . $f["id"]);
    echo "</td>\n";
    label_cell(get_name($attrib_h), "nowrap");
    label_cell(get_short($attrib_h));
    label_cell(get_author($attrib_h));
    label_cell(get_create_date($attrib_h) . hidden("id", $f["id"], false) . hidden("attr", $attrib_h, false));
    if ($act) {
        label_cell("<input type=\"button\" class=\"inputsubmit\" name=\"run\" value=\"" . _("Run") . "\" \n  \t\t\tonclick=\"javascript:displayReport(document.edit, " . $f["id"] . ");\"");
    } else {
        label_cell("");
    }
    submit_cells("change", CHANGE);
    submit_cells("delete", DELETE);
    submit_cells("copy", COPY);
    echo "<td style='width;0px;display:none;'>\n";
    end_form();
    echo "</td>\n";
    end_row();
}
end_form();
Ejemplo n.º 13
0
    ?>
		<?php 
    while (posts()) {
        ?>
		<article>
			<header>
				<h1><a href="<?php 
        echo article_url();
        ?>
"><?php 
        echo article_title();
        ?>
</a></h1>
				<div class="meta">
				<?php 
        echo get_author();
        ?>
				</div>
			</header>

			<?php 
        if (article_description()) {
            echo "<p>" . article_description() . "</p>";
        } else {
            echo split_content(article_markdown());
        }
        ?>
      
      <p><a href="<?php 
        echo article_url();
        ?>
Ejemplo n.º 14
0
function reading_list(){

	// step 0 : delete feeds from db
	//1. connect to BDD		
	$pdo_options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION;
	$bdd = new PDO(DB_PMBA, DB_USER, DB_PWD);
	$bdd->exec("SET CHARACTER SET utf8");

	$count = 0;
	
	// 2. clean
	$bdd->exec('DELETE FROM reading_list');
	
	
	$url = "http://personalmba.com/best-business-books/";
	$pmba_url = "http://personalmba.com";
	
	$html = connect_to($url,$book);
	$html = str_get_html($html);
	
	// 2. get category
	$h2 = $html->find('h2[id]');
	
	foreach($h2 as $category){
		
		$en_category = $category->innertext;		
		$list_books = $category->next_sibling()->find('li');
		foreach($list_books as $book){
		
			//3. info
			$title = $book->find('a',0)->plaintext;
			$amazon_com_url = $pmba_url.$book->find('a',0)->href;
			$author = $book->plaintext;
			$id =  get_id($author);
			$author = get_author($author);			
			$en_review = $pmba_url.$book->find('a',1)->href;

			$fr_category = "";
			$fr_review = "";						
			$amazon_best_url = "";
			$amazon_price = "";
			$cheapest_price = "";
			$ship_price = "";
			$ISBN = "";

			// step 4 : insert in db		
			$request = 'INSERT INTO reading_list VALUES(\''.$id.'\', \''.$title.'\', \''.$author.'\', \''.$en_category.'\', \''.$fr_category.
						'\', \''.$en_review.'\', \''.$fr_review.'\', \''.$amazon_com_url.'\', \''.$amazon_best_url.'\', \''.$amazon_price.'\', \''.$cheapest_price.'\', \''.$ship_price.'\', \''.$ISBN.'\')';
			$bdd->exec($request);	
			
			echo $id."\n";
		}
	}
		
	
	$html->clear(); 
	unset($html);
	
		
	// and now we're done; close it
	$bdd = null;
}
Ejemplo n.º 15
0
/**
 * Parses news text or news data so that it is displayed along with its template.
 * @param string|array $news_string News text to parse, or the array from the required news file.
 * @param array $settings Override settings when parsing.
 * @return Parsed news text
 */
function parse_news_to_view($news_string, $settings = array())
{
    assert(is_array($settings));
    global $fsnw, $wfpost, $ht, $smilies, $bb, $stfpop, $compop, $furl, $fullnewsh, $fullnewsw, $fullnewss, $fullnewsz, $fslink, $datefor, $stflink, $stfheight, $stfwidth, $stfscrolls, $stfresize, $pclink, $datefor, $link_headline_fullstory, $hurl, $comheight, $comwidth, $comscrolls, $comresize;
    $news_text = array();
    if (!empty($news_string)) {
        $icon = '';
        $email = '';
        $writer = '';
        $link_full_news = '';
        $link_comments = '';
        $link_tell_friend = '';
        $article = $news_string;
        if (!is_array($news_string)) {
            $article = get_line_data('news', $news_string);
        }
        // Get the template HTML
        $news_tmpl = get_template((isset($settings['template']) ? $settings['template'] : 'news_temp') . '.php', false);
        $other_qs = clean_query_string();
        $news_url = isset($settings['news_url']) ? $settings['news_url'] : '';
        $sep = strpos($news_url, '?') === false ? '?' : '&amp;';
        // Create the 'read more...' link
        if ($article['fullnews'] != '') {
            if ($fsnw) {
                $link_full_news = '<a href="' . $furl . '/fullnews.php?fn_id=' . $article['news_id'] . '" onclick="window.open(this.href,\'\',\'height=' . $fullnewsh . ',width=' . $fullnewsw . ',toolbar=no,menubar=no,scrollbars=' . $fullnewss . ',resizable=' . $fullnewsz . '\'); return false">' . $fslink . '</a>';
            } else {
                $link_full_news = '<a href="' . $news_url . $sep . 'fn_mode=fullnews&amp;fn_id=' . $article['news_id'] . $other_qs . '">' . $fslink . '</a>';
            }
        }
        // Create the comments link
        if ($compop) {
            $link_comments = '<a href="' . $furl . '/comments.php?fn_id=' . $article['news_id'] . '" onclick="window.open(this.href,\'\',\'height=' . $comheight . ',width=' . $comwidth . ',toolbar=no,menubar=no,scrollbars=' . $comscrolls . ',resizable=' . $comresize . '\'); return false">' . $pclink . '</a>';
        } else {
            $link_comments = '<a href="' . $news_url . $sep . 'fn_mode=comments&amp;fn_id=' . $article['news_id'] . $other_qs . '">' . $pclink . '</a>';
        }
        // Create the tell a friend link
        if ($stfpop) {
            $link_tell_friend = '<a href="' . $furl . '/send.php?fn_id=' . $article['news_id'] . '" onclick="window.open(this.href,\'\',\'height=' . $stfheight . ',width=' . $stfwidth . ',toolbar=no,menubar=no,scrollbars=' . $stfscrolls . ',resizable=' . $stfresize . '\'); return false">' . $stflink . '</a>';
        } else {
            $link_tell_friend = '<a href="' . $news_url . $sep . 'fn_mode=send&amp;fn_id=' . $article['news_id'] . $other_qs . '">' . $stflink . '</a>';
        }
        // Make sure the number of comments is 0 or above.
        $num_comments = max((int) $article['numcomments'], 0);
        // Get author information
        $author = get_author($article['author']);
        if ($author === false) {
            $author = array('showemail' => false, 'nick' => $article['author']);
        }
        // Create the icon
        if (strpos($news_tmpl, '{icon}') !== false && !empty($author['icon'])) {
            $icon = '<img src="' . $author['icon'] . '" alt="" />';
        }
        // Put the writer's name with his email as a link, or in some cases not.
        $email = $author['showemail'] ? $author['email'] : '';
        if (!$email) {
            $writer = $author['nick'];
        } else {
            $writer = '<a href="mailto:' . $author['email'] . '">' . $author['nick'] . '</a>';
        }
        // Get our new lines back
        $article['shortnews'] = str_replace('&br;', $ht ? '' : '<br />', $article['shortnews']);
        $article['fullnews'] = str_replace('&br;', $ht ? '' : '<br />', $article['fullnews']);
        $article['headline'] = format_message($article['headline'], $ht, $bb, $smilies, $wfpost);
        $article['shortnews'] = format_message($article['shortnews'], $ht, $bb, $smilies, $wfpost);
        $article['fullnews'] = format_message($article['fullnews'], $ht, $bb, $smilies, $wfpost);
        $file = file(FNEWS_ROOT_PATH . 'categories.php');
        array_shift($file);
        $categories = explode(',', $article['categories']);
        $cat_icon = '';
        $cat_id = 0;
        $cat_name = '';
        $category_filter = isset($settings['category']) ? $settings['category'] : array();
        $num_category_filter = sizeof($category_filter);
        foreach ($file as $category) {
            $category = get_line_data('categories', $category);
            if ($num_category_filter > 0 && in_array($category['category_id'], $category_filter) || $num_category_filter == 0 && in_array($category['category_id'], $categories)) {
                $cat_icon = $category['icon'] != '' ? '<img src="' . $category['icon'] . '" alt="" />' : '';
                $cat_id = $category['category_id'];
                $cat_name = $category['name'];
                break;
            }
        }
        $news_text = array('post_id' => $article['news_id'], 'link_tell_friend' => $link_tell_friend, 'link_full_news' => $link_full_news, 'subject' => $article['headline'], 'description' => $article['description'], 'writer' => $writer, 'email' => $email, 'date' => date($datefor, (int) $article['timestamp']), 'icon' => $icon, 'news' => $article['shortnews'], 'fullnews' => $article['fullnews'], 'cat_icon' => $cat_icon, 'cat_id' => $cat_id, 'cat_name' => $cat_name);
        if (strpos($news_tmpl, '{comments}') !== false) {
            $news_text += array('nrc' => $num_comments, 'link_comments' => $link_comments);
        } else {
            $news_text += array('nrc' => '', 'link_comments' => '');
        }
        // Replace in the values!
        $news_tmpl = replace_masks($news_tmpl, array('post_id' => $news_text['post_id'], 'user' => $news_text['writer'], 'date' => $news_text['date'], 'icon' => $news_text['icon'], 'send' => $news_text['link_tell_friend'], 'nrc' => $news_text['nrc'], 'cat_id' => $news_text['cat_id'], 'cat_name' => $news_text['cat_name'], 'cat_icon' => $news_text['cat_icon'], 'fullstory' => $news_text['link_full_news'], 'comments' => $news_text['link_comments'], 'subject' => '<a id="fus_' . $news_text['post_id'] . '"></a>' . $news_text['subject'], 'news' => $news_text['news'], 'description' => $news_text['description']));
        $news_text += array('display' => $news_tmpl);
    }
    return $news_text;
}
Ejemplo n.º 16
0
    }
}
// delete author
if (isset($_POST['confirm_delete_author']) && $_POST['confirm_delete_author'] == 'Yes') {
    $author_id = (int) $_GET['author_id'];
    $delete_status = delete_author($author_id);
    if ($delete_status === true) {
        $reload = $_SERVER["PHP_SELF"] . '?page_name=authors';
        header('Location: ' . $reload);
    } else {
        $error = $delete_status;
    }
}
// author list
$author_id = isset($_GET['author_id']) ? (int) $_GET['author_id'] : $_SESSION[WW_SESS]['user_id'];
$author = get_author($author_id);
// check if author has written any articles
$usage = get_articles_stats(1);
// redirect if author details not found
if (empty($author)) {
    $reload = $_SERVER["PHP_SELF"] . '?page_name=authors';
    header('Location: ' . $reload);
}
// any content generation
$left_text = $author['name'];
$right_text = $author['level'];
$page_header = show_page_header($left_text, $right_text);
$main_content = $page_header;
// confirm file delete
if (isset($_GET['action']) && $_GET['action'] == 'delete' && empty($usage)) {
    $main_content .= '
Ejemplo n.º 17
0
             $contribroleid = get_field('role', 'id', 'shortname', ROLE_LPCONTRIBUTOR);
             foreach ($lp['contributors'] as $conid) {
                 $user = get_record('user', 'username', $conid);
                 if (!empty($user)) {
                     role_assign($contribroleid, $user->id, 0, $coursecontext->id);
                     $useridarray[] = $user->id;
                 }
             }
         }
         //now do stuff with Participants
         $ptroleid = get_field('role', 'id', 'shortname', ROLE_PT);
         $sql = "SELECT participant.id, participant.email FROM participant_has_presentation, participant WHERE " . "participant_has_presentation.p_id=" . $rec['id'] . " AND " . "participant.id=participant_has_presentation.u_id";
         $rs2 = $dbh->Execute($sql);
         if (!empty($rs2)) {
             while ($rec2 = $rs2->FetchRow()) {
                 $author = get_author($dbh, $rec2, $errors);
                 if (!empty($author)) {
                     role_assign($ptroleid, $author->id, 0, $coursecontext->id);
                 }
             }
         }
         //now change status to published if record is "visible"
         //change -1 states to "suspended"
         $course = get_record('course', 'id', $courseid);
         if ($rec['visible'] == 1) {
             tao_update_course_status(COURSE_STATUS_PUBLISHED, 'Legacy Import', $course);
         } elseif ($rec['visible'] == -1) {
             tao_update_course_status(COURSE_STATUS_SUSPENDEDAUTHOR, 'Legacy Import', $course);
         }
     }
 }
Ejemplo n.º 18
0
		<!-- .author-avatar -->
		<div class="author-description">
			<h3 class="author-title">
				<span
					class="author-heading"><?php 
_e('Author:', 'hocwp-theme');
?>
</span> <?php 
echo esc_html(get_author());
?>
			</h3>

			<p class="author-bio">
				<?php 
author_meta('description');
?>
				<a class="author-link" href="<?php 
echo esc_url(get_author_posts_url(get_author_meta('ID')));
?>
"
				   rel="author">
					<?php 
printf(esc_html__('View all posts by %s', 'hocwp-theme'), esc_html(get_author()));
?>
				</a>
			</p><!-- .author-bio -->
		</div>
		<!-- .author-description -->
	</div><!-- .author-info -->
<?php 
do_action('hocwp_after_author_box');
Ejemplo n.º 19
0
</th>
                  <th> <?php 
    echo DELETE;
    ?>
</th>
            </tr>
              </thead>
              <tbody>



             <?php 
    $count = 1;
    foreach ($this->saved_poems as $fetch_poem) {
        if ($fetch_poem['author_id']) {
            $fetch_poem['author_id'] = get_author($this->database, $fetch_poem['author_id']);
        }
        //pr($fetch_poem);
        ?>

                  <tr>
                      
                  <td><?php 
        echo $count;
        $count++;
        ?>
</td>
             <td> <a href="<?php 
        echo get_url($this->database, 'poem', $fetch_poem['id'] . "/" . $fetch_poem['poem_slug']);
        ?>
"><?php 
Ejemplo n.º 20
0
function get_data()
{
    if (!in_the_loop()) {
        return;
    }
    return ['type' => get_type(), 'parent' => get_parent(), 'categories' => get_categories(), 'tags' => get_tags(), 'taxonomies' => get_taxonomies(), 'author' => get_author(), 'published' => date_published(), 'updated' => date_updated()];
}
Ejemplo n.º 21
0
        <button type="submit" class="btn btn-primary">Найти</button>
    </div>
</form>
        


    </p>
<?php 
echo Html::a('Добавить книгу', ['create'], ['class' => 'btn btn-success']);
?>
    <?php 
$monthes = [1 => 'Января', 2 => 'Февраля', 3 => 'Марта', 4 => 'Апреля', 5 => 'Мая', 6 => 'Июня', 7 => 'Июля', 8 => 'Августа', 9 => 'Сентября', 10 => 'Октября', 11 => 'Ноября', 12 => 'Декабря'];
$timeago = new TimeAgo();
echo GridView::widget(['dataProvider' => $dataProvider, 'columns' => ['id', 'name', ['label' => 'Автор', 'format' => 'raw', 'value' => function ($model, $key, $index, $column) use($authors) {
    return get_author($model, $authors);
}], ['attribute' => 'date_create', 'format' => 'raw', 'value' => function ($model) use($monthes) {
    $date = explode("-", $model->date_create);
    return $date[2] . " " . $monthes[(int) $date[1]] . " " . $date[0];
}], ['attribute' => 'date_update', 'format' => 'raw', 'value' => function ($model) use($timeago) {
    return $timeago->run($model->date_update);
}], ['attribute' => 'preview', 'format' => 'raw', 'value' => function ($model) {
    return '<a href="#_js" data-toggle="modal" data-target="#imagePreview" data-image="' . $model->preview . '"><img src="' . $model->preview . '" height="40"></img></a>';
}], ['class' => 'yii\\grid\\ActionColumn', 'template' => '{view} {update} {delete}', 'buttons' => ['view' => function ($url, $model, $key) {
    return '<a href="#_js" onClick="bookPreviewOpen(\'' . $url . '\');return false;"><span class="glyphicon glyphicon-eye-open"></span></a>';
}]]]]);
function get_author($model, $authors)
{
    foreach ($authors as $author) {
        if ($author->author_id == $model->author_id) {
            return $author->firstname . " " . $author->lastname;
Ejemplo n.º 22
0
function simpl_preprocess_page(&$vars)
{
    if ($vars['is_front']) {
        // load homepage promoted menu
        $vars['menus']['promoted'] = render_menu('menu-promoted');
        // load populare content
        $vars['popular'] = get_v('popular');
        //        pprint($vars['popular']);
        $vars['nq'] = array();
        // load hero nodequeue
        $nq_hero = nodequeue_load_nodes(1, false, 0, 1);
        foreach ($nq_hero as $node) {
            $hero[] = n_load($node->nid);
        }
        $vars['nq']['hero'] = $hero;
        // load promoted nodequeue
        $nq_featured = nodequeue_load_nodes(2, false, 0, 3);
        foreach ($nq_featured as $node) {
            $featured[] = n_load($node->nid);
        }
        $vars['nq']['featured'] = $featured;
        // load latest nodequeue
        $nq_latest = nodequeue_load_nodes(4, false, 0, 12);
        foreach ($nq_latest as $node) {
            $latest[] = n_load($node->nid);
        }
        $vars['nq']['latest'] = $latest;
        // load opinions nodequeue
        $nq_opinions = nodequeue_load_nodes(5, false, 0, 6);
        foreach ($nq_opinions as $node) {
            $opinions[] = $node->nid;
        }
        $vars['nq']['opinions'] = array_values(node_load_multiple($opinions));
        //$vars['opinions'] = array_values(get_vn('taxonomy_term', array('all', 1,'blog'), 5));
    }
    /* Node page */
    if (!empty($vars['node'])) {
        $GLOBALS['body-class'] = 'node-page';
        $vars['n'] = node_load($vars['node']->nid);
        $section_id = $vars['n']->field_section['und'][0]['tid'];
        $tags = $vars['n']->field_tags['und'];
        if (count($tags)) {
            $tags_ids = [];
            foreach ($tags as $tag) {
                $tags_ids[] = $tag['tid'];
            }
        }
        $vars['more'] = array_values(get_vn('taxonomy_term', array(join('+', $tags_ids), 1, 'article', $vars['node']->nid), 3));
        $vars['readlist'] = array_values(get_vn('taxonomy_term', array($section_id, 1, 'article+blog+gallery'), 5));
        $vars['related'] = array_values(get_vn('taxonomy_term', array($section_id, 1, $vars['n']->type), 5));
        $vars['tags'] = get_tags($vars['n']);
        $vars['popular'] = get_v('popular');
        if ($vars['node']->type == 'article') {
            //create dedicated page for node, f**k the drupal nesting shit
            $vars['theme_hook_suggestions'][] = '__article';
            $vars['r'] = node_view($vars['n'])['body'][0]['#markup'];
            $vars['author'] = get_author($vars['n']);
        } else {
            if ($vars['node']->type == 'blog') {
                $vars['theme_hook_suggestions'][] = '__blog';
                $author = get_author($vars['n']);
                $vars['blog']['author'] = $author;
                //pprint($author);
                $element1 = array('#tag' => 'meta', '#attributes' => array('property' => 'og:image', 'content' => render_image('x585', $author->image_src)));
                $element2 = array('#tag' => 'link', '#attributes' => array('rel' => 'image_src', 'type' => 'image/jpeg', 'href' => render_image('x585', $author->image_src)));
                drupal_add_html_head($element1, 'element1');
                drupal_add_html_head($element2, 'element2');
                // load opinions nodequeue
                $nq_opinions = nodequeue_load_nodes(5, false, 0, 6);
                foreach ($nq_opinions as $node) {
                    $opinions[] = $node->nid;
                }
                $vars['nq']['opinions'] = array_values(node_load_multiple($opinions));
                $vars['readlist'] = array_values(get_vn('opinions_author', array($vars['blog']['author']->nid, $vars['node']->nid), 5));
            } else {
                if ($vars['node']->type == 'author') {
                    $vars['theme_hook_suggestions'][] = '__author';
                    $vars['author'] = get_author($vars['n']);
                    $element1 = array('#tag' => 'meta', '#attributes' => array('property' => 'og:image', 'content' => render_image('x585', $vars['author']->image_src)));
                    $element2 = array('#tag' => 'link', '#attributes' => array('rel' => 'image_src', 'type' => 'image/jpeg', 'href' => render_image('x585', $vars['author']->image_src)));
                    drupal_add_html_head($element1, 'element1');
                    drupal_add_html_head($element2, 'element2');
                    // load opinions nodequeue
                    $nq_opinions = nodequeue_load_nodes(5, false, 0, 6);
                    foreach ($nq_opinions as $node) {
                        $opinions[] = $node->nid;
                    }
                    $vars['nq']['opinions'] = array_values(node_load_multiple($opinions));
                    $vars['opinions_author'] = array_values(get_vn('opinions_author', array($vars['n']->nid, 0), 10));
                    //pprint($vars['opinions_author']);
                } else {
                    if ($vars['node']->type == 'social') {
                        $vars['author'] = get_author($vars['n']);
                        $vars['theme_hook_suggestions'][] = '__social';
                    } else {
                        if ($vars['node']->type == 'page') {
                            $vars['theme_hook_suggestions'][] = '__static';
                        }
                    }
                }
            }
        }
    }
    /* --- Node page ----- */
    /* Taxonomy Term pages */
    if (arg(0) == 'taxonomy' && arg(1) == 'term' && arg(4) == 'blog') {
        // load opinions nodequeue
        $nq_opinions = nodequeue_load_nodes(5, false, 0, 6);
        foreach ($nq_opinions as $node) {
            $opinions[] = $node->nid;
        }
        $vars['nq']['opinions'] = array_values(node_load_multiple($opinions));
        $vars['theme_hook_suggestions'][] = '__opinions';
    }
    /* --- Taxonomy Term pages ----- */
}
Ejemplo n.º 23
0
            </a>

            <div class="search-date"><?php 
    echo render_ar_date($n->created);
    ?>
</div>

            <p>
                <?php 
    echo render_teaser($n, 90);
    ?>
                ...
            </p>
            <?php 
    $a = get_author($n);
    ?>
            <div class="author">
                <img class="a-img" src="<?php 
    echo $a->image;
    ?>
" alt="">

                <div class="a-info">
                    <div class="a-name">
                        <?php 
    echo $a->title;
    ?>
                    </div>
                    <div class="a-title">
                        <?php 
Ejemplo n.º 24
0
     if (!login()) {
         file_cache($_SERVER['REQUEST_URI']);
     }
 }
 $post = find_post($year, $month, $name);
 $current = $post['current'];
 if (!$current) {
     not_found();
 }
 if (config("views.counter") == "true") {
     add_view($current->file);
     if (!login()) {
         file_cache($_SERVER['REQUEST_URI']);
     }
 }
 $author = get_author($current->author);
 if (isset($author[0])) {
     $author = $author[0];
 } else {
     $author = default_profile($current->author);
 }
 if (array_key_exists('prev', $post)) {
     $prev = $post['prev'];
 } else {
     $prev = array();
 }
 if (array_key_exists('next', $post)) {
     $next = $post['next'];
 } else {
     $next = array();
 }
Ejemplo n.º 25
0
function formatAidHeader($aid)
{
    $AidHeader = get_author($aid);
    echo $AidHeader;
}
Ejemplo n.º 26
0
function themearticle($aid, $informant, $datetime, $title, $thetext, $topic, $topicname, $topicimage, $topictext)
{
    global $admin, $sid, $tipath;
    $ThemeSel = get_theme();
    if (file_exists("themes/{$ThemeSel}/images/topics/{$topicimage}")) {
        $t_image = "themes/{$ThemeSel}/images/topics/{$topicimage}";
    } else {
        $t_image = "{$tipath}{$topicimage}";
    }
    $posted = "" . _POSTEDON . " {$datetime} " . _BY . " ";
    $posted .= get_author($aid);
    if (!empty($notes)) {
        $notes = "<br><br><b>" . _NOTE . "</b> <i>{$notes}</i>\n";
    } else {
        $notes = "";
    }
    if ("{$aid}" == "{$informant}") {
        $content = "{$thetext}{$notes}\n";
    } else {
        if (!empty($informant)) {
            $content = "<a href=\"modules.php?name=Your_Account&amp;op=userinfo&amp;username={$informant}\">{$informant}</a> ";
        } else {
            $content = "{$anonymous} ";
        }
        $content .= "" . _WRITES . " <i>\"{$thetext}\"</i>{$notes}\n";
    }
    $tmpl_file = "themes/3D-Fantasy/story_page.html";
    $thefile = implode("", file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"" . $thefile . "\";";
    eval($thefile);
    print $r_file;
}
Ejemplo n.º 27
0
function find_post($id)
{
    $id = mysql_real_escape_string($id);
    $id = str_replace('-', ' ', $id);
    $query = mysql_query("SELECT * FROM blog_posts WHERE title='{$id}'");
    $postArray = array();
    while ($row = mysql_fetch_array($query)) {
        $comments = get_comments($row['id']);
        $author = get_author($row['author_id']);
        $likes = get_post_likes($row['id']);
        $postArray[] = array('id' => $row["id"], 'title' => $row['title'], 'post' => $row['posts'], 'postfull' => $row['postfull'], 'author' => $author, 'date_posted' => $row['date_posted'], 'comments' => $comments, 'likes' => $likes);
    }
    foreach ($postArray as $v) {
        $date = $v['date_posted'];
        $post->date = $date;
        $post->id = $v['id'];
        $post->title = $v['title'];
        $post->body = $v['post'];
        $post->comments = $v['comments']['total'];
        $post->author = $v['author'][0]['name'];
        $post->author_id = $v['author'][0]['id'];
        $post->likes = $v['likes'][0]['likes'];
        return $post;
    }
    //return $false;
    //  return false;
}