Example #1
0
        <th>Compo</th>
    </tr>
</thead>
<tbody>
<?php 
$result = $mysqli->query('
SELECT `author`, `filename`, `title`, `points`, `place`, `name`, `entries`.`idcompo` AS `idcompo`
    FROM `entries`, `compos`
    WHERE `entries`.`idcompo` = `compos`.`idcompo`
    AND `points` IS NOT NULL
    ORDER BY `points` DESC
    LIMIT 0, 10
') or die('query failed');
while ($row = $result->fetch_assoc()) {
    echo '<tr><td>', $row['points'], '</td>
        <td>', ordinalize($row['place']), '</td>
        <td title="', htmlspecialchars($row["title"]), '"><a href="javascript:;" onclick="javascript:play(this)"><img src="{{BASE}}img/play.png" width="16" height="16" alt="Play" title="Play"></a> <a href="{{BASE}}pack/', $row['idcompo'], '/', urlencode($row['filename']), '">', htmlspecialchars($row['filename']), '</a></td>
        <td><a href="{{BASE}}search?what=', urlencode($row['author']), '&amp;author=1">', htmlspecialchars($row['author']), '</a></td>
        <td><a href="{{BASE}}compo/', $row['idcompo'], '">', htmlspecialchars($row['name']), '</a></td>
        </tr>';
}
$result->free();
?>
</tbody>
</table>

<h2>Authors with most winner entries</h2>

<table class="stats">
<thead>
    <tr>
         $last_days_arr = "'" . implode("','", $last_days) . "'";
         //echo $last_days_arr;
         $last_days_value = $this->user_model->get_translate_languages('en', array("{$last_days_arr}"));
         $last_days_main_arr = array();
         for ($l = 0; $l < count($last_days_value); $l++) {
             if ($lang == 'de') {
                 $last_days_main_arr = $last_days_value[$l]['de'];
             } elseif ($lang == 'fr') {
                 $last_days_main_arr = $last_days_value[$l]['fr'];
             } else {
                 $last_days_main_arr = $last_days_value[$l]['en'];
             }
         }
         $last_days_main_value = $last_days_main_arr;
     } else {
         $last_days_main_value = ordinalize($schedule[$i]['day_of_the_month']);
     }
 }
 // echo $last_days_main_value ;
 //                                    echo "<pre>";print_r($schedule);
 //                                    echo $last_days_main_arr."<br/>";
 //                                    echo $schedule[$i]['day_of_the_month'];
 //echo "<pre>";print_r($last_days_main_arr);exit;
 if ($lang == 'de') {
     $final_sending_content = $sending_content[0]['de'];
     $after_keyword_content = $ending_content[0]['de'];
 } elseif ($lang == 'fr') {
     $final_sending_content = $sending_content[0]['fr'];
     $after_keyword_content = $ending_content[0]['fr'];
 } else {
     $final_sending_content = $sending_content[0]['en'];
Example #3
0
function Upload_response()
{
    //*************************************************
    global $_, $filename, $ipath, $page, $EX, $message, $UPLOAD_FIELDS;
    $page = "index";
    //return to index.
    $filecount = 0;
    foreach ($_FILES['upload_file']['name'] as $N => $name) {
        if ($name == "") {
            continue;
        }
        //ignore empty upload fields
        $filecount++;
        $filename = $_FILES['upload_file']['name'][$N];
        $destination = $ipath;
        $savefile_msg = '';
        $MAXUP1 = ini_get('upload_max_filesize');
        //$MAXUP2 = ''; //number_format($_POST['MAX_FILE_SIZE']).' '.hsc($_['bytes']);
        $ERROR = $_FILES['upload_file']['error'][$N];
        if ($ERROR == 1) {
            $ERRMSG = hsc($_['upload_err_01']) . ' upload_max_filesize = ' . $MAXUP1;
        } elseif ($ERROR == 2) {
            $ERRMSG = hsc($_['upload_err_02']);
        } elseif ($ERROR == 3) {
            $ERRMSG = hsc($_['upload_err_03']);
        } elseif ($ERROR == 4) {
            $ERRMSG = hsc($_['upload_err_04']);
        } elseif ($ERROR == 5) {
            $ERRMSG = hsc($_['upload_err_05']);
        } elseif ($ERROR == 6) {
            $ERRMSG = hsc($_['upload_err_06']);
        } elseif ($ERROR == 7) {
            $ERRMSG = hsc($_['upload_err_07']);
        } elseif ($ERROR == 8) {
            $ERRMSG = hsc($_['upload_err_08']);
        } else {
            $ERRMSG = '';
        }
        if ($destination === false || $destination != "" && !is_dir($destination)) {
            $message .= $EX . '<b>' . hsc($_['upload_msg_02']) . '</b><br>';
            $message .= '<span class="filename">' . hte($destination) . '</span></b><br>';
            $message .= hsc($_['upload_msg_03']) . '</b><br>';
        } else {
            $message .= '<b>' . hsc($_['upload_msg_04']) . '</b> <span class="filename">' . hte($filename) . '</span><br>';
            if (isset($_POST['ifexists']) && $_POST['ifexists'] == 'overwrite') {
                $savefile = $destination . $filename;
                if (is_file($savefile)) {
                    $savefile_msg .= $_['upload_msg_07'];
                }
            } else {
                //rename to "file.etc.001"  etc...
                $savefile = ordinalize($destination, $filename, $savefile_msg);
            }
            if (move_uploaded_file($_FILES['upload_file']['tmp_name'][$N], $savefile)) {
                $message .= '<b>' . hsc($_['upload_msg_05']) . '</b> ' . $savefile_msg . '<br>';
            } else {
                $message .= '<b>' . $EX . hsc($_['upload_msg_06']) . '</b> ' . $ERRMSG . '</b><br>';
            }
        }
    }
    //end foreach $_FILES
    if ($filecount == 0) {
        $page = "upload";
    }
    //If nothing selected, just reload Upload page.
}
Example #4
0
            }
            $every_d = _clang(EVERY) . " " . $every_temp . " " . $senddata;
            $selected_edit = $schedule_id == $schedule[$i]['schedule_id'] ? "selected='selected'" : "";
            if ($schedule[$i]['ends'] == "Never") {
                $ends_in = _clang(ENDS) . " " . $after_keyword_content;
            } else {
                if ($schedule[$i]['ends'] == "after") {
                    $ends_in = _clang(ENDS) . " " . $after_keyword_content . " " . $schedule[$i]['ends_after'] . " " . _clang(OCCURRENCES);
                } else {
                    if ($schedule[$i]['ends'] == "on") {
                        $ends_in = _clang(ENDS) . " " . $after_keyword_content . " " . $schedule[$i]['ends_on'];
                    }
                }
            }
            $monthly_content = "";
            $monthly_content .= $schedule[$i]['monthly_on'] == 'day_of_the_month' ? _clang(ON) . " " . ordinalize($schedule[$i]['day_of_the_month']) . " " : " ";
            $monthly_content .= $schedule[$i]['monthly_on'] == 'weekday' ? _clang(ON) . " " . $schedule[$i]['monthly_weekday_count'] . " " . $monthly_on . " " : "";
            $data .= '<option ' . $selected_edit . ' value="' . $schedule[$i]['schedule_id'] . '">' . $final_sending_content . " " . $every_d . " " . $monthly_content . " " . $days_value . " " . _clang(AT) . " " . date("H.i", strtotime($schedule[$i]['at'] . ":00:00")) . " " . _clang(TO_EMAIL) . " " . $schedule[$i]['sending_to_email'] . " " . $ends_in . "</option>";
        }
        $data .= '</select>
    </div>
    <div class="link_button">
		<div class="' . get_if_free_user('class_free_user_overlay_4') . '" ' . get_if_free_user('manage_schedule_popup_2') . ' ></div>
        <div class="left_link"><a onclick="submitform(\'gotoschedule\')" href="javascript:void(0)">' . _clang(NEW_SCHEDULE_PA) . '</a></div>
        <div class="right_button"><input style="margin-bottom: 5px; float: right; margin-top: 1px; padding-left: 18px; padding-right: 18px;" class="btn btn_main" value="' . _clang(OK_BUTTON) . '" name="Submit" type="submit" /><a href="#" class="cancel popup_close">' . _clang(CANCEL_P_A) . '</a></div>
    </div>
	</form>
        <form id="gotoschedule" action="' . site_url('myknewdog') . '" method="post">
                                <input type="hidden" name="form" value="section_3" />
                            </form>
            if ($lang == 'de') {
                $final_sending_content = $sending_content[0]['de'];
            } elseif ($lang == 'fr') {
                $final_sending_content = $sending_content[0]['fr'];
            } else {
                $final_sending_content = $sending_content[0]['en'];
            }
            ?>
                                        <div class="sendingscheduale">
                                            <b><?php 
            echo _clang(SENDING_SCHEDULE);
            ?>
</b><label>
                                                <?php 
            $monthly_content = "";
            $monthly_content .= $get_schedule_by_id[0]['monthly_on'] == 'day_of_the_month' ? _clang(ON) . " " . ordinalize($get_schedule_by_id[0]['day_of_the_month']) . " " : " ";
            $monthly_content .= $get_schedule_by_id[0]['monthly_on'] == 'weekday' ? _clang(ON) . " " . $get_schedule_by_id[0]['monthly_weekday_count'] . " " . $monthly_on . " " : "";
            echo $final_sending_content . " " . $every . " " . $days_value . " " . $monthly_content . " " . _clang(AT) . " " . date("H.i", strtotime($get_schedule_by_id[0]['at'] . ":00:00"));
            ?>
                                            </label>
                                        </div>
                                        <div class="sendingemail"><b><?php 
            echo _clang(SENDING_MAIL);
            ?>
</b><label><?php 
            echo $get_schedule_by_id[0]['sending_to_email'];
            ?>
</label><img style="cursor:pointer;" onclick="popups_ajax('subscribe_1_edit', '<?php 
            echo $mynl_newsletter[$i]['newsletter_id'];
            ?>
', '<?php 
Example #6
0
require BASE_PATH . 'lib/PostPageParser.php';
if (config_item('post_url') == '' && config_item('archive_url') == '') {
    die('request url does not setting correct');
}
$post_list = array();
if ($archive_url = config_item('archive_url')) {
    $archive_parser = new ArchivePageParser();
    do {
        //加上'?viewmode=contents'的后缀,一页能显示更多条内容
        $archive_parser->init($archive_url . '?viewmode=contents');
        $archive_parser->parse();
        $post_list = array_merge($archive_parser->get_post_list(), $post_list);
        if ($archive_parser->has_next_page()) {
            $archive_url = $archive_parser->next_page_url();
        }
        $archive_parser->free();
    } while ($archive_parser->has_next_page());
} else {
    $post_list[] = array('url' => config_item('post_url'));
}
$post_parser = new PostPageParser();
foreach ($post_list as $index => $each_post) {
    $post_parser->init($each_post['url']);
    $post_parser->parse();
    $post_parser->save2md();
    $title = isset($each_post['title']) ? $each_post['title'] : $post_parser->get_title();
    echo 'the ' . ordinalize(++$index) . ' article already generated, title: ' . $title;
    echo "\n";
    @ob_flush();
    flush();
}