<br /> (
	<?php 
while ($sub_category_array = $db->fetch_assoc($sql)) {
    $category_link = openld_link('index_cat', array($sub_category_array['id'], str_replace(' ', '-', $sub_category_array['title'])));
    echo ($first == false ? ', ' : '') . '<a href="' . $category_link . '">' . openld_htmlspecialchars($sub_category_array['title']) . '</a>';
    $first = false;
}
?>
)<br />
Example #2
0
				<tr>
					<th class="tcl" scope="col">
						<?php 
    echo $_GET['search_type'] == 'categories' ? CATEGORIES_LABEL : LINKS_LABEL;
    ?>
					</th>
				</tr>
			</thead>
			<tbody class="hasicon">
				<?php 
    ($hook = get_hook('search_results_tbody_header')) ? eval($hook) : null;
    ?>
				<?php 
    while ($row = $db->fetch_assoc($sql_string_limit)) {
        if ($_GET['search_type'] == 'categories') {
            $row['url'] = openld_link('index_cat', se_index_cat($row));
        }
        ?>
				<tr>
					<td class="tcl">
						<?php 
        ($hook = get_hook('search_result_rows_header')) ? eval($hook) : null;
        ?>
						<a href="<?php 
        echo $row['url'];
        ?>
"<?php 
        echo $settings['open_links_in_new_windows'] == 'Y' && $_GET['search_type'] == 'links' ? ' target="_blank"' : '';
        ?>
><?php 
        echo openld_htmlspecialchars($row['title']);
Example #3
0
		</p>
		<br /><br />
		<?php 
if ($db->num_rows($categories_result) > 0) {
    ?>
			<?php 
    ($hook = get_hook('categories_header')) ? eval($hook) : null;
    ?>
			<table cellspacing="0" summary="" class="category">
				<?php 
    $colums_while = 1;
    ?>
				<?php 
    while ($category = $db->fetch_assoc($categories_result)) {
        echo $colums_while == 1 ? '<tr>' : '';
        $category_link = openld_link('index_cat', se_index_cat($category));
        ?>
						<td class="tcl">
							<?php 
        ($hook = get_hook('categories_category_cells_header')) ? eval($hook) : null;
        ?>
							<a href="<?php 
        echo $category_link;
        ?>
"><?php 
        echo openld_htmlspecialchars($category['title']);
        ?>
</a><?php 
        ($hook = get_hook('ccc_after_link')) ? eval($hook) : null;
        ?>
<br />
Example #4
0
echo '<?xml version="1.0" encoding="utf-8"?>';
?>

<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[<?php 
echo $settings['title'] . $extra_title;
?>
]]></title>
		<description><![CDATA[<?php 
echo $_GET['rss'] != 0 ? $fetch_category_row[1] : $settings['description'];
?>
]]></description>
		<link><?php 
echo $_GET['rss'] != 0 ? openld_link('index_cat', se_index_cat($_GET['rss'])) : $settings['domain'];
?>
</link>
		<generator>OpenLD</generator>
		<atom:link href="<?php 
echo $settings['domain'] . '/index.php?rss=' . $_GET['rss'];
?>
" rel="self" type="application/rss+xml" />
<?php 
while ($links = $db->fetch_assoc($link_result)) {
    ?>
		<item>
			<title><![CDATA[<?php 
    echo $links['title'];
    ?>
]]></title>
Example #5
0
        case "alphabetical":
            $query['ORDER BY'] = $db->escape($_GET['search_in']);
            break;
        case "alphabetical_reversed":
            $query['ORDER BY'] = $db->escape($_GET['search_in']) . " DESC";
            break;
        case "newest_first":
            $query['ORDER BY'] = 'id DESC';
            break;
        case "oldest_first":
            $query['ORDER BY'] = 'id ASC';
            break;
    }
    // Search query
    $start_limit = $settings['number_of_search_results_per_page'] * ($req_page - 1);
    ($hook = get_hook('search_before_sql')) ? eval($hook) : null;
    $query_limit = $query;
    $query_limit['LIMIT'] = $start_limit . ", " . $settings['number_of_search_results_per_page'];
    ($hook = get_hook('search_sql')) ? eval($hook) : null;
    //for both $sql_string_limit and $search_results
    $sql_string_limit = $db->query_build($query_limit) or error("Couldn't run the search query sql_string_num", __FILE__, __LINE__);
    $search_results = $db->query_build($query) or error("Couldn't run the search query", __FILE__, __LINE__);
    ($hook = get_hook('search_after_sql')) ? eval($hook) : null;
    //link_pagination() cannot be used, since it relies on the $settings['number_of_links_per_page'] setting
    $num_rows = $db->num_rows($search_results);
    $num_pages = ceil($num_rows / $settings['number_of_search_results_per_page']);
    $pagination = paginate($num_pages, $req_page, openld_link('search_page', se_search($_GET)));
}
$page = 'search.php';
($hook = get_hook('search_before_page')) ? eval($hook) : null;
require "footer.php";
Example #6
0
  Copyright (C) 2006-2010  Anders Persson (anders_persson@home.se)

  OpenLD is free software; you can redistribute it and/or
  modify it under the terms of the GNU General Public License
  as published by the Free Software Foundation; either version 2
  of the License, or (at your option) any later version.

  OpenLD is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

************************************************************************/
function microtime_float()
{
    list($usec, $sec) = explode(" ", microtime());
    return (double) $usec + (double) $sec;
}
$time_start = microtime_float();
require OPENLD_ROOT . 'include/common.php';
require OPENLD_ROOT . 'include/se_friendly.php';
($hook = get_hook('header_top_hook')) ? eval($hook) : null;
$submit_id = openld_link('submit', se_submit($_GET));
$suggest_id = openld_link('suggest', se_suggest($_GET));
$meta_description = $settings['description'];
// is set to category decription in index.php
$head_title = isset($_GET['category']) && $_GET['category'] !== 'root' ? $settings['title'] . ' - ' . $_GET['category'] : $settings['title'];
Example #7
0
function display_navbar($id, $url = null)
{
    global $db;
    $path_string = "";
    while ($id != 0) {
        $query = array('SELECT' => 'title, father_id, id, description', 'FROM' => 'categories', 'WHERE' => 'id=' . intval($id) . OPENLD_IF_ACTIVE_CATS);
        ($hook = get_hook('navigation_sql')) ? eval($hook) : null;
        $result = $db->query_build($query) or error(__FILE__, __LINE__);
        if ($db->num_rows($result) == 0) {
            $path_string = ' - no result' . $path_string;
            $id = 0;
        } else {
            $therow = $db->fetch_row($result);
            //to complement fetch_row's lack of functionality
            $therow['title'] = $therow[0];
            $therow['father_id'] = $therow[1];
            $therow['id'] = $therow[2];
            $therow['description'] = $therow[3];
            if ($url == null) {
                $link_url = openld_link('index_cat', se_index_cat($therow));
            } else {
                $link_url = $url . '?id=' . $therow['id'];
            }
            $path_string = ' - <a href="' . $link_url . '">' . $therow['title'] . '</a>' . $path_string;
            $id = $therow['father_id'];
            // pick the father_id from the db
        }
        ($hook = get_hook('categories_path_navigation_cell')) ? eval($hook) : null;
    }
    return $path_string;
}