Пример #1
0
 function do_process()
 {
     $freebie_code = ym_request('freebie_code');
     if ($freebie_code) {
         $this->common_process($freebie_code, 'Free/Coupon', TRUE, FALSE);
         list($buy, $what, $id, $user_id) = explode('_', $freebie_code);
         if ($what == 'subscription') {
             $data = array('id' => $id, 'cost' => 'Free/Coupon', 'duration' => 1, 'item_name' => get_bloginfo() . ' ' . __('Subscription Purchase:', 'ym') . ' ' . $post_title);
         } else {
             if ($what == 'post') {
                 $data = array('post_id' => $id, 'ppp' => true, 'cost' => 'Free/Coupon', 'duration' => 1, 'item_name' => get_bloginfo() . ' ' . __('Post Purchase:', 'ym') . ' ' . get_post_title($id));
             } else {
                 // assume bundle
                 $bundle = ym_get_bundle($id);
                 $data = array('ppp_pack_id' => $id, 'ppp' => true, 'cost' => 'Free/Coupon', 'duration' => 1, 'item_name' => get_bloginfo() . ' ' . __('Bundle Purchase:', 'ym') . ' ' . $bundle->name);
             }
         }
         $this->redirectlogic($data, TRUE);
     }
     $custom = ym_request('custom');
     if (!$custom) {
         echo 'No Data Passed';
         return;
     }
     list($buy, $what, $pack_id, $user_id) = explode('_', $custom);
     // verify
     $safe = FALSE;
     global $ym_packs;
     foreach ($ym_packs->packs as $pack) {
         if ($pack['id'] == $pack_id) {
             $cost_test = $pack['cost'];
             if (strpos($cost_test, '.')) {
                 $cost_test = $cost_test * 100;
             }
             if ($cost_test == 0) {
                 $safe = TRUE;
             }
         }
     }
     if (!$safe) {
         // error
         print_r($_POST);
         echo 'Could not Find a pack match';
         return;
     }
     $this->do_buy_subscription($pack_id, $user_id, TRUE);
 }
Пример #2
0
function new_get_posts()
{
    $num = 0;
    $link = mysql_connection();
    mysqli_select_db($link, "test");
    $result = mysqli_query($link, "SELECT id FROM content WHERE type = 'post'");
    while ($row = mysqli_fetch_object($result)) {
        $ID = $row->id;
        $num = $num + 1;
        if ($num % 2 != 0) {
            if (has_thumbnail($ID)) {
                echo '<div class="parallax-window" data-parallax="scroll" data-bleed="50" data-speed="0.1" data-image-src="' . get_thumbnail_link($ID) . '"></div>' . "\n";
            }
            echo '<section id="post-' . $ID . '" class="post bright">' . "\n" . '<article>' . "\n" . '<h2><a href="' . get_post_link($ID) . '">' . get_post_title($ID) . '</a></h2>' . "\n" . '<p>' . get_post_preview($ID) . '<p>' . "\n" . '</article>' . "\n" . '</section>' . "\n";
        } else {
            if (has_thumbnail($ID)) {
                echo '<div class="parallax-window" data-parallax="scroll" data-bleed="50" data-speed="0.1" data-image-src="' . get_thumbnail_link($row->id) . '"></div>' . "\n";
            }
            echo '<section id="post-' . $ID . '" class="post dark">' . "\n" . '<article>' . "\n" . '<h2><a href="' . get_post_link($ID) . '">' . get_post_title($ID) . '</a></h2>' . "\n" . '<p>' . get_post_preview($ID) . '<p>' . "\n" . '</article>' . "\n" . '</section>' . "\n";
        }
    }
}
Пример #3
0
function draw_post_header($title = '', $excerpt = '', $bg = '', $size = 'full', $parallax = 'off')
{
    ////KC::debug(wp_get_attachment_image_src(get_post_thumbnail_id(1480), 'full'));
    $title = get_post_title($title);
    $excerpt = get_post_excerpt($excerpt);
    $bg = get_post_bg($bg, $size);
    $classes = "draw-post-header";
    if ($bg == KC::$default_header_image) {
        $classes .= " default-bg";
        $parallax = "off";
    }
    // possibly set these from custom post types
    //$parallax = "off"; // on/off
    $title = "<h2><span>{$title}</span></h2>";
    if ($excerpt) {
        $excerpt = "<h3><span>{$excerpt}</span></h3>";
    }
    KC::debug($excerpt);
    $content = <<<EOT
    [et_pb_section admin_label="section" background_image="{$bg}" transparent_background="on" allow_player_pause="off" inner_shadow="off" parallax="{$parallax}" parallax_method="true"
\t\tcustom_padding="" padding_mobile="on" make_fullwidth="off" use_custom_width="off" width_unit="on" make_equal="off" use_custom_gutter="off"]

\t[et_pb_row admin_label="row" make_fullwidth="off" use_custom_width="off" width_unit="off" custom_width_percent="" use_custom_gutter="off"
\t    padding_mobile="off" allow_player_pause="off" parallax="on" parallax_method="off" make_equal="off" column_padding_mobile="on"]

\t    [et_pb_column type="4_4"]

\t\t[et_pb_cta admin_label="Call To Action" title="" url_new_window="off" use_background_color="on" background_color="" background_layout="" text_orientation=""
\t\t\tcustom_margin="" custom_padding="" custom_button="off" button_letter_spacing="0" button_use_icon="default" button_icon_placement="right" button_on_hover="on" button_letter_spacing_hover="0"]
\t\t    {$title}
\t\t    {$excerpt}
\t\t[/et_pb_cta]
\t    [/et_pb_column]
\t[/et_pb_row]
    [/et_pb_section]
EOT;
    echo '<div class="' . $classes . '">' . do_shortcode($content) . '</div>';
}
Пример #4
0
    $parent = $_GET['parent'];
} else {
    $parent = $_POST['parent'];
}
if (!$area) {
    $area = 1;
}
if (!$error) {
    if (!$parent) {
        $parent = 0;
        if (!$title) {
            $title = 'New Post';
        }
    } else {
        // get post name
        $title = get_post_title($parent);
        // append Re:
        if (strstr($title, 'Re: ') == false) {
            $title = 'Re: ' . $title;
        }
        //make sure title will still fit in db
        $title = substr($title, 0, 20);
        //prepend a quoting pattern to the post you are replying to
        $message = add_quoting(get_post_message($parent));
    }
}
//  do_html_header($title);
//  display_tree($chapterid,$_SESSION['expended']);
display_new_post_form($courseid, $poster, $parent, $area, $message);
if ($error) {
    echo "<p>Your message was not stored.</p>\n           <p>Make sure you have filled in all fields and try again.</p>";
Пример #5
0
/**
 * @param type $title - 'text', title, author
 * @param type $excerpt - 'text', excerpt
 * @param type $bg - 'url', featured, author
 * @param type $size - '', full
 * @param type $parallax - '', css, js
 * @param type $height - '', full
 */
function draw_post_header($title, $excerpt, $bg, $size, $parallax, $height)
{
    $title = get_post_title($title);
    $excerpt = get_post_excerpt($excerpt);
    $bg = get_post_bg($bg, $size);
    $classes = 'draw-post-header';
    if ($bg == KC::$default_header_image) {
        $classes .= ' default-bg';
    }
    //$parallax = 'js';
    if ($parallax === 'css') {
        $parallax = 'on';
        $parallax_method = 'off';
    } elseif ($parallax === 'js' || $parallax === 'on') {
        $parallax = 'on';
        $parallax_method = 'on';
    } else {
        $parallax = 'off';
        $parallax_method = 'off';
    }
    $classes .= ' parallax-' . $parallax;
    $classes .= ' parallax-method-' . $parallax_method;
    if ($title) {
        $title = "<h2><span>{$title}</span></h2>";
    }
    if ($excerpt) {
        $excerpt = "<h3><span>{$excerpt}</span></h3>";
    }
    //    if (true || $height === 'full') {
    $classes .= " height-full";
    $header_fullscreen = $height === 'full' ? 'on' : 'off';
    $text_orientation = 'center';
    // left center right
    $content_orientation = 'center';
    // top center bottom
    $content = <<<EOT
        [et_pb_section admin_label="section" background_image="{$bg}" transparent_background="on" inner_shadow="on" parallax="{$parallax}" parallax_method="{$parallax_method}" module_id=""
            fullwidth="on" specialty="off"]

        [et_pb_fullwidth_header admin_label="Fullwidth Header" background_layout="dark" text_orientation="{$text_orientation}" header_fullscreen="{$header_fullscreen}" 
            header_scroll_down="off" scroll_down_icon="%%0%%" parallax="" parallax_method="" 
            content_orientation="{$content_orientation}" image_orientation="center" custom_button_one="off" button_one_letter_spacing="0" button_one_use_icon="default" button_one_icon_placement="right" button_one_on_hover="on" button_one_letter_spacing_hover="0" 
            custom_button_two="off" button_two_letter_spacing="0" button_two_use_icon="default" button_two_icon_placement="right" button_two_on_hover="on" button_two_letter_spacing_hover="0" button_one_text="" 
            button_one_text_size="20" button_one_border_width="2" button_one_border_radius="50" button_one_border_radius_hover="3" button_two_text_size="20" button_two_border_width="2" button_two_border_radius="50" button_two_border_radius_hover="3"
            background_url="" background_overlay_color="rgba(0,0,0,0)" 
            logo_image_url="" logo_alt_text="" logo_title="" title="" button_one_url=""]
        {$title}
        {$excerpt}
        [/et_pb_fullwidth_header]
        [/et_pb_section]
EOT;
    //    }
    //    else {
    //        $classes .= " height-default";
    //        $content = <<<EOT
    //        [et_pb_section admin_label="section" background_image="$bg" transparent_background="on" allow_player_pause="off" inner_shadow="off"
    //            parallax="$parallax" parallax_method="$parallax_method"
    //            custom_padding="" padding_mobile="on" make_fullwidth="off" use_custom_width="off" width_unit="on" make_equal="off" use_custom_gutter="off"]
    //
    //            [et_pb_row admin_label="row" make_fullwidth="off" use_custom_width="off" width_unit="off" custom_width_percent="" use_custom_gutter="off"
    //                padding_mobile="off" allow_player_pause="off" parallax="on" parallax_method="off" make_equal="off" column_padding_mobile="on"]
    //
    //                [et_pb_column type="4_4"]
    //
    //                    [et_pb_cta admin_label="Call To Action" title="" url_new_window="off" use_background_color="on" background_color="" background_layout="" text_orientation=""
    //                            custom_margin="" custom_padding="" custom_button="off" button_letter_spacing="0" button_use_icon="default" button_icon_placement="right" button_on_hover="on" button_letter_spacing_hover="0"]
    //                        $title
    //                        $excerpt
    //                    [/et_pb_cta]
    //                [/et_pb_column]
    //            [/et_pb_row]
    //        [/et_pb_section]
    //EOT;
    //    }
    echo '<div class="' . $classes . '">' . do_shortcode($content) . '</div>';
}
function display_comments_nav($paged_comments)
{
    $output = false;
    $comments_list = '<div class="comments-list">';
    $header = '<div class="comments-header-nav">
                    <div class="column-1">Select</div>
                    <div class="col-2">Comment</div>
                </div>';
    $markup = '<div class="comment-item">';
    $markup .= '<div class="column-1">';
    $markup .= '<input id="%1$s" value="%2$s" name="selected-comments[]" type="checkbox" />';
    $markup .= '<label for="%1$s"><div class="pretty-radio"></div></label>';
    $markup .= '</div>';
    $markup .= '<div id="attach-%2$s" class="col-2">';
    $markup .= '<input id="%3$s" type="checkbox"/>';
    $markup .= '<label for="%3$s">';
    $markup .= '<p class="clickable" style="cursor:pointer;">%4$s: <strong>%5$s</strong>  %6$s on: <strong>%7$s</strong> and said:</p>';
    $markup .= '</label>';
    $markup .= '<div class="comment-box-container">';
    $markup .= '<p><i>%8$s</i></p>';
    $markup .= '<p>User email: <strong>%9$s</strong> | User website: <strong>%10$s</strong></p>';
    $markup .= '<div class="comment-box-actions">';
    $markup .= '<a data-target="attach-%2$s" class="half-button button mat-button" %11$s>%12$s</a>';
    $markup .= '<a class="half-button button mat-button red-button" href="%13$s">DELETE</a>';
    $markup .= '</div>';
    $markup .= '</div>';
    $markup .= '</div>';
    $markup .= '</div>';
    if (is_array($paged_comments)) {
        //$comments_list .= $header;
        foreach ($paged_comments as $comm) {
            $approve_bt_text = 'APPROVE';
            $approve_bt_href = '';
            $approve_bt_act = '';
            $repliedto = 'COMMENTED';
            if (!empty($comm['commentparent'])) {
                $parent = get_comment_data_byID((int) $comm['commentparent']);
                $repliedto = 'REPLIED to: ' . $parent['user']['name'];
            }
            if (isset($_GET['status'])) {
                switch ($_GET['status']) {
                    case 'PENDING':
                        $approve_bt_text = 'APPROVE';
                        break;
                    case 'APPROVED':
                        $approve_bt_text = 'REPLY';
                        break;
                }
            } else {
                if (isset($_GET['action'])) {
                    switch ($_GET['action']) {
                        case 'allcomments':
                            $approve_bt_text = 'REPLY';
                            break;
                        case 'pendingcomments':
                            $approve_bt_text = 'APPROVE';
                            break;
                    }
                }
            }
            if ($approve_bt_text === 'REPLY') {
                $cc_par = !empty($comm['commentparent']) ? $comm['commentparent'] : '0';
                $approve_bt_href = 'onclick="open_comment_box( this, ' . $comm['id'] . ', ' . $cc_par . ', ' . $comm['postparent'] . ' )"';
            } else {
                $approve_bt_href = 'href="' . ADMINURL . '?action=approvecomment&commentid=' . $comm['id'] . '&status=' . $comm['status'] . '"';
            }
            $comments_list .= sprintf($markup, 'comment-' . $comm['id'], $comm['id'], 'comment-box-' . $comm['id'], $comm['date'], $comm['user']['name'], $repliedto, get_post_title((int) $comm['postparent']), $comm['content'], $comm['user']['email'], $comm['user']['website'], $approve_bt_href, $approve_bt_text, ADMINURL . '?action=deletecomment&commentid=' . $comm['id'] . '&status=' . $comm['status']);
        }
        //$comments_list .= $header;
        $comments_list .= '<div>';
    }
    echo $comments_list;
}
Пример #7
0
echo $ID;
?>
" class="mbd-layout-post">
<?php 
if (has_thumbnail($ID)) {
    ?>
    <div class="mbd-layout-post-header thumbnail">
<?php 
} else {
    ?>
    <div class="mbd-layout-post-header">
<?php 
}
?>
        <h2><?php 
get_post_title($ID);
?>
</h2>
    </div>
    <div class="mbd-layout-post-content">
        <?php 
get_post_preview($ID);
?>
    </div>
    <div class="mbd-layout-post-meta">
        <img src="<?php 
get_user_image_url(get_autor_id($ID));
?>
" class="mbd-layout-post-meta-image"/>
        <p class="mbd-layout-post-meta-autor"><?php 
get_user_name(get_autor_id($ID));
Пример #8
0
function get_posts()
{
    $link = mysqli_connect("localhost", "root", "") or die("Keine Verbindung möglich: " . mysql_error());
    mysqli_select_db($link, "test");
    $result = mysqli_query($link, "SELECT id FROM content WHERE type = 'post'");
    while ($row = mysqli_fetch_object($result)) {
        $ID = $row->id;
        echo '<article class="post">' . "\n" . '<h4><a href="' . get_post_link($ID) . '">' . get_post_title($ID) . '</a></h4>' . "\n" . '<p>' . get_post_preview($ID) . '</p>' . "\n" . '<a class="more" href="' . get_post_link($ID) . '">Mehr lesen</a>' . '</article>' . "\n";
    }
}