Home Community Mys-Script Creative Off-Topic |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Paging in admin panel für images
The following patch provides paging for the image menu in admin panel.
Useful for slow connections and/or many pictures stored in filemap database table diff -ruw v1.3.4/admincp/image.php src/admincp/image.php Code:
--- v1.3.4/admincp/image.php 2013-08-24 23:29:48.000000000 +0200 +++ src/admincp/image.php 2014-01-26 18:18:36.000000000 +0100 @@ -103,11 +103,20 @@ public function manage(){ $mysidia = Registry::get("mysidia"); - $stmt = $mysidia->db->select("filesmap", array("id", "wwwpath")); + // anno1986 added paging for images + $total = $mysidia->db->select("filesmap", array("id"))->rowCount(); + $pagination = new Pagination($total, 9, "admincp/image/delete"); + $pagination->setPage($mysidia->input->get("page")); + // anno1986 added paging for images + $stmt = $mysidia->db->select("filesmap", array("id", "wwwpath"), "1 LIMIT {$pagination->getLimit()},{$pagination->getRowsperPage()}"); $filesMap = new LinkedHashMap; while($file = $stmt->fetchObject()){ - $filesMap->put(new Integer($file->id), new Image($file->wwwpath)); + $img = new Image($file->wwwpath); + //$img->resample(100,null); + $filesMap->put(new Integer($file->id), $img); } + // anno1986 added paging for images + $this->setField("pagination", $pagination); $this->setField("filesMap", $filesMap); } diff -ruw v1.3.4/admincp/view/imageview.php src/admincp/view/imageview.php Code:
--- v1.3.4/admincp/view/imageview.php 2013-04-26 21:04:22.000000000 +0200 +++ src/admincp/view/imageview.php 2014-01-26 18:15:00.000000000 +0100 @@ -36,7 +36,12 @@ $document->setTitle($this->lang->manage_title); $document->addLangvar($this->lang->manage); + $pagination = $this->getField("pagination"); + $imageForm = new Form("manageform", "delete", "post"); + // anno1986 added paging to image view + $imageForm->add(new Comment($pagination->showPage())); + $filesMap = $this->getField("filesMap"); $iterator = $filesMap->iterator(); while ($iterator->hasNext()){ @@ -46,10 +51,17 @@ $fileImage->setLineBreak(TRUE); $action = new RadioButton("Delete this Image", "iid", $fileID->getValue()); - $action->setLineBreak(TRUE); + //$action->setLineBreak(TRUE); + $imageForm->add(new Comment("<div style='display:inline-block;width:270px;margin-top:20px;'>",FALSE)); $imageForm->add($fileImage); $imageForm->add($action); + + $imageForm->add(new Comment("</div>", FALSE)); + } + // anno1986 added paging to image view + $imageForm->add(new Comment($pagination->showPage())); + $imageForm->add(new Button("Submit", "submit", "submit")); $document->add($imageForm); } |
#2
|
||||
|
||||
This doesn't really explain how to add the fix. It might be ok for coders but some of us are beginners or even non coders.
__________________
Failing at being normal since 1990. |
#3
|
||||
|
||||
after trying and testing I manage to make the code work, because copy and paste just gives a blank page, and so i will post the code thats working for me for those that don't have idea what to do... like me XD
in admincp/image.php find: PHP Code:
PHP Code:
PHP Code:
PHP Code:
and thanks anno1986 for posting the code ^^ because if i tried to do it myself i probably wont be able to do it. also replace the "20" with the number of images you want to see in each page and replace "100" with the max width of your adoptbles. |
Tags |
admin, image, imageview, paging |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Help with Admin Panel please | WCadopts | Questions and Supports | 1 | 08-17-2015 02:05 AM |
Admin Panel Question | parayna | Questions and Supports | 5 | 05-26-2013 09:18 PM |
Newly installed site and problem with Admin Control Panel | 5404 | Questions and Supports | 5 | 01-23-2013 03:26 PM |
Admin CP? | booksbooks098 | Questions and Supports | 2 | 12-06-2012 05:37 PM |
Can't get into the Admin Panel? | densaugeo | Questions and Supports | 16 | 03-28-2009 07:08 PM |
What's New? |
What's Hot? |
What's Popular? |