site documentation
Posted in
7578
12:02 am, June 17, 2021
use a list group for listing by category page [todo]
change this to a list group, should make it neater.
Page to update: https://kruxor.com/list-category/code/
so for some reason this is listed using this function
PHP
$list_wiki_menu = $class->list_wiki_menu();
not sure why i called it that, anyway...
here is the full function, it selects all the distinct categories and then lists all the items under each one.
PHP
public function list_wiki_menu($mode = "widget", $start = 0, $max = 1000) {
$out = "";
$db_table_name = $this->db->escapeString($this->db_table_name);
$start = $this->db->escapeString($start);
$max = $this->db->escapeString($max);
$db_table_name = $this->db->escapeString($this->db_table_name);
$sql = "select distinct category from $db_table_name";
$result = $this->db->query($sql);
if($result) {
while($row = $result->fetchArray()) {
$category = $row['category'];
$sql_cat = "select * from $db_table_name where category = '$category' order by title asc limit $start,$max";
$result_cat = $this->db->query($sql_cat);
if($mode == "home") {
$out .= "<div class='col-lg-12'>";
}
$out .= "<ul>$category";
while($row_cat = $result_cat->fetchArray()) {
$this->load_from_id($row_cat['id']);
$nice_link = $this->generate_view_link();
$title = $row_cat['title'];
$out .= "<li><a href='$nice_link'>$title</a></li>";
}
$out .= "</ul>";
if($mode == "home") {
$out .= "</div>";
}
}
}
if($mode == "widget") {
/*$out = "<h2><i class=\"far fa-file-alt\"></i> $this->nice_name</h2>$out";*/
}
if($mode == "home") {
$out = "<div class='row'>$out</div>";
}
return $out;
}
Maybe a card style for each category with the list group inside it, something like this? i think this looks a bit neater.
View Statistics
This Week
190
This Month
1018
This Year
2110
Add Comment
Other Items in site documentation
function to load one latest item with a start val load_latest_single_num
make the view number zoom when mouse over or active
moving the hits widget into the post header and footer
for auto filled fields, need to change the text and background colours
use a list group for listing by category page [todo]
Comments Listing should be a custom list rather than using search
load the latest single item only
load oldest item based on insdate then update the insdate to now - load_latest_single_update
change this to a list group - other items
hero widget header - creates a nice looking hero item from a target uid and class
dropdown section
Latest from Code Widget
Related Search Terms
Other Categories in Code
alpine js apps c css factorio font awesome images linux quick modals sqlite site bugs site updates slick slider sliders testing windows apps apache api apps asp bat bootstrap bootstrap templates charts cookies core css css filters css grid design elements docker domains emoji fancybox fonts foundation framework gimp git html icons ideas image formatting images javascript javascript functions jquery js linux mac misc modals mysql nginx node php php errors php function php functions php simple html dom pi400 python react regex sections simple_html_dom simplepie php site bugs site documentation slick slider sql sqlite ssh sublime svg svg css templates tools virtual box vscode vue webdev windows windows 11 windows commands wordpress