Example #1
0
File: index.php Project: rick/rdtj
     print "<blockquote>\n";
     # set flag to denote opened album nesting
     $inalbum = 1;
 }
 if ($expand == $tag or $expand == $atag) {
     # if this album/artist is expanded then output song play link
     # protect db query if necessary
     $dbalbum = $slashes ? $album : addslashes($album);
     $dbartist = $slashes ? $artist : addslashes($artist);
     $firstsong = 1;
     # flag for whether we're on the first song
     # retrieve songs for this album
     $res = mysql_query("select songid, title, length,\n\t\t\talbumposition, filename from songs where\n\t\t\talbum='{$dbalbum}' and artist='{$dbartist}' order by\n\t\t\tartist, album, albumposition", $dbi);
     if ($res and mysql_num_rows($res)) {
         while (list($songid, $title, $length, $albumposition, $filename) = mysql_fetch_row($res)) {
             $timestring = readable_time($length);
             # this flag must be set to close formatting/forms elsewhere
             $listing_songs = 1;
             # provide song administration interface
             #
             # this interface is different from the others since we
             # want to be able to reorder songs on the album as well
             # as edit their information...
             if ($admin_allow_song) {
                 if (!$admin_songs) {
                     # provide link for song administration, normal links
                     if ($firstsong) {
                         # only print the admin link with the first song
                         print "<a href=\"index.php?player={$player}&expand={$tag}&admin_songs=1#{$tag}\">!</a>\n";
                     } else {
                         # keep the spacing (hopefully) consistent
Example #2
0
    
    <a href="' . get_option('home') . '/?l=tw' . '"><img src="' . get_template_directory_uri() . '/img/twitter-button.png' . '" width="133" height="24" class="twitterbutton"/></a>
    <div id="fbconnect">
        <fb:login-button scope="offline_access,publish_stream" onlogin="******">Log in with Facebook</fb:login-button>
    </div>';
    return $return;
}
add_shortcode('wpanswers_signup', 'shortcode_signup');
// [wpanswers_popular_questions]
function shortcode_popular_questions($atts)
{
    global $post;
    $post_name = $post->post_name;
    $paged = get_query_var('paged') ? get_query_var('paged') : 1;
    query_posts('post_type=question&orderby=comment_count&order=DESC&paged=' . $paged);
    $return = '';
    while (have_posts()) {
        the_post();
        $return .= '<div ' . get_post_class('question') . ' id="post-' . get_the_ID() . '">
<table>
<tr >
<td style="background-color:#F5F5F5;margin-left:20px;"  width="15%">
        <div style="margin-left:20px;" class="questionnumber"><p ><a href="' . get_permalink(get_the_ID()) . '#comments">' . get_comments_number('' . __('0', 'wp-answers') . '', '' . __('1', 'wp-answers') . '', '' . __('%', 'wp-answers') . '') . '</a></p></div>
</td>
        		<td width="85%">
        <div class="questionmain">
        <h2 class="questiontitle"><a href="' . get_permalink() . '">' . get_the_title() . '</a></h2>
        <ul class="questionmeta">
        <li>' . __('Asked in:', 'wp-answers') . ' ' . get_the_term_list(get_the_ID(), 'question_category') . '</li>
        <li>' . __('Asked By', 'wp-answers') . ' ' . '<a class="url fn n" href="' . get_link_to_profile(get_the_author_meta('user_login')) . '">' . get_the_author() . '</a></li>
        <li>Asked on ' . get_the_time('F j, Y') . '</li>
        </div>
        </ul>
/** freeleech countdown **/
function freeleech_countdown()
{
    global $CURUSER, $mc1, $lang, $INSTALLER09;
    $htmlout = $freetitle = '';
    $cimg = '<img src="pic/cat_free.gif" alt="FREE!" />';
    $freeleech['freeleech_countdown'] = $mc1->get_value('freeleech_countdown');
    if ($freeleech['freeleech_countdown'] === false) {
        $freeleech['freeleech_sql'] = sql_query('SELECT var, amount FROM freeleech WHERE type = "countdown"') or sqlerr(__FILE__, __LINE__);
        $freeleech['freeleech_countdown'] = array();
        if (mysqli_num_rows($freeleech['freeleech_sql']) !== 0) {
            $freeleech['freeleech_countdown'] = mysqli_fetch_assoc($freeleech['freeleech_sql']);
        } else {
            //$freeleech_sunday = strtotime('next Sunday');
            $freeleech['freeleech_countdown']['var'] = 0;
            $freeleech['freeleech_countdown']['amount'] = strtotime('next Monday');
            // timestamp sunday
            sql_query('UPDATE freeleech SET var = ' . $freeleech['freeleech']['var'] . ', amount = ' . $freeleech['freeleech_countdown']['amount'] . '
                       WHERE type = "countdown"') or sqlerr(__FILE__, __LINE__);
        }
        $mc1->cache_value('freeleech_countdown', $freeleech['freeleech_countdown'], 0);
    }
    if ($freeleech['freeleech_countdown']['var'] !== 0 && TIME_NOW > $freeleech['freeleech_countdown']['var']) {
        // end of freeleech sunday
        $freeleech['freeleech_countdown']['var'] = 0;
        $freeleech['freeleech_countdown']['amount'] = strtotime('next Monday');
        // timestamp sunday
        sql_query('UPDATE freeleech SET var = ' . $freeleech['freeleech_countdown']['var'] . ', amount = ' . $freeleech['freeleech_countdown']['amount'] . ' 
                       WHERE type = "countdown"') or sqlerr(__FILE__, __LINE__);
        $mc1->begin_transaction('freeleech_countdown');
        $mc1->update_row(false, array('var' => $freeleech['freeleech_countdown']['var'], 'amount' => $freeleech['freeleech_countdown']['amount']));
        $mc1->commit_transaction(0);
    } elseif (TIME_NOW > $freeleech['freeleech_countdown']['amount']) {
        // freeleech sunday!
        if ($freeleech['freeleech_countdown']['var'] == 0) {
            $freeleech['freeleech_countdown']['var'] = strtotime('next Monday');
            $ahead_by = readable_time($freeleech['freeleech_countdown']['var'] - 86400 - $freeleech['freeleech_countdown']['amount']);
            //'.$ahead_by.'
            sql_query('UPDATE freeleech SET var = ' . $freeleech['freeleech_countdown']['var'] . ' 
                       WHERE type = "countdown"') or sqlerr(__FILE__, __LINE__);
            $mc1->begin_transaction('freeleech_countdown');
            $mc1->update_row(false, array('var' => $freeleech['freeleech_countdown']['var']));
            $mc1->commit_transaction(0);
            $free_message = 'Freeleech is now active! Making for ' . $ahead_by . ' of Freeleech! Thanks to all ' . $INSTALLER09['site_name'] . ' Members!' . 'It will end at Monday 12:00 am GMT';
            //== log shoutbot ircbot
            require_once INCL_DIR . 'bbcode_functions.php';
        }
        $freetitle = 'Freeleech in effect!';
        $freemessage = '<img src="pic/smilies/w00t.gif" alt="" /> ' . 'All Torrents <b>FREE</b> till ' . date('D F j, g:i a', $freeleech['freeleech_countdown']['var'] + ($CURUSER['time_offset'] + $CURUSER['dst_in_use']) * 60) . '</span> ' . '<img src="pic/smilies/w00t.gif" alt="" />';
        $freeleech['remaining'] = $freeleech['freeleech_countdown']['var'] - TIME_NOW;
        $htmlout .= '
         <li>
     <a class="tooltip" href="#"><b class="btn btn-success btn-small">' . $lang['gl_freeleech'] . '</b>
	 <span class="custom info alert alert-success"><em>' . $freetitle . '</em>' . 'ends&nbsp;at ' . date('D F j, g:i a', $freeleech['freeleech_countdown']['var'] + ($CURUSER['time_offset'] + $CURUSER['dst_in_use']) * 60) . '</span></a></li>';
        return $htmlout;
    }
    $freeleech['remaining'] = $freeleech['freeleech_countdown']['amount'] - TIME_NOW;
    $htmlout .= '
         <li>
     <a class="tooltip" href="#"><b class="btn btn-info btn-small">Freeleech</b>
	 <span class="custom info alert alert-info"><em>' . $freetitle . '</em> ' . 'starts&nbsp;at ' . date('D F j, g:i a', $freeleech['freeleech_countdown']['amount'] + ($CURUSER['time_offset'] + $CURUSER['dst_in_use']) * 60) . '<br /></span></a></li>';
    return $htmlout;
}
Example #4
0
 bytes gzipped)</li>
                            <li>Final size: <?php 
    echo readable_size(strlen($process_data['css']));
    ?>
 (<?php 
    echo strlen(gzencode($process_data['css'], 9));
    ?>
 bytes gzipped)</li>
                            <li>Difference: <strong><?php 
    printf('%s (%+g%%)', readable_size(strlen($process_data['css']) - strlen($process_data['source']), true), round(strlen($process_data['css']) / strlen($process_data['source']) * 100, 2));
    ?>
</strong></li>
                        </ul>
                        <ul>
                            <li>Duration: <?php 
    echo readable_time($process_data['execution_time']);
    ?>
</li>
                        </ul>
                    </div>     
                <?php 
}
?>
            </div>
            <div id="submit">
                <input type="submit" />
            </div>            
        </form>
        <?php 
if (!empty($process_data['errors'])) {
    echo '<h3>Errors</h3>';
Example #5
0
?>
<br/>
<?php 
echo !empty($_user_data) ? $_user_data->occupation : '';
?>

</p>

<p>
<?php 
_e('Interests', 'wp-answers');
?>
<br/>
<?php 
echo !empty($_user_data) ? $_user_data->interests : '';
?>

</p>

<p>
<?php 
_e('Avatar', 'wp-answers');
?>
<br/>
<?php 
echo get_user_avatar(!empty($_user_data) ? $_user_data->ID : '');
?>

</p>

<div style="clear:both; height:40px;"></div>