john ackers
Forum Replies Created
-
Forum: Plugins
In reply to: [dbview] error when show userThe scripts like ‘show user’ that have a % in them get loaded and invoked from other scripts that pass an argument (the user id) to them. They don’t run in isolation. Sorry the error message is misleading.
Forum: Plugins
In reply to: [dbview] DB ImagesAre you saying that the update 0.5.3 hasn’t fixed the 0 results issue above?
Forum: Plugins
In reply to: [dbview] DB ImagesGoing to check in updated version tomorrow (and with slevit’s changes).
Forum: Plugins
In reply to: [dbview] DB ImagesYep, you are right. Sorry. Will try to commit fix next week. Here is a clue to temp fix
if (isset($dcols)) // added line foreach($this->dview->cellFunction as $name=>$unused) // fyi - ignore orphaned cell names'
Forum: Plugins
In reply to: [dbview] DB ImagesIt works for me on localhost and shared host. And I cut and pasted the SQL and PHP from the post above.
Forum: Plugins
In reply to: [dbview] DB ImagesHere’s another way of doing this without creating an extra, unwanted column, SQL is:
select id, concat('https://www.google.co.uk/images/srpr/logo11w.png',',','https://www.google.com') as link from wp_posts limit 2
PHP is:
$a = explode(",",$value); return "<a href='".$a[1]."'><img src='".$a[0]."' /></a>";
Forum: Plugins
In reply to: [dbview] DB ImagesSorry. Try returning one space. Or
return " " ;
Forum: Plugins
In reply to: [dbview] Sintax problemdbview is only intended to display database data in a table. You can execute inserts, updates, and deletes but you can only execute one SQL statement in each dbview not five. Sorry.
Forum: Plugins
In reply to: [dbview] DB ImagesYes, someone has raised that before. My only suggestion is to use CSS to hide the column or put
return '';
as a PHP snippet in the top of the unwanted column which will blank the column. Put the the column in the middle of the table and make it a feature! There does need to be a clean way to suppress display columns and sorry don’t have time to implement on this at moment.
Forum: Plugins
In reply to: [dbview] DB ImagesIf you this SQL
SELECT ID, 'https://www.google.co.uk/images/srpr/logo11w.png' AS 'image', 'https://www.google.com' as 'link' FROM wp_posts limit 2
and this PHP snippet above the link column
return "<a href='".$value."'><img src='".$row['image']."'./>/a>";
you can click on the images in the 3rd column and get taken to google.
Forum: Plugins
In reply to: [dbview] DB ImagesOk. Are you using just SQl or SQL + php, I am not sure where we are starting from.
Forum: Plugins
In reply to: [dbview] Pagination Doesn't workTry dropping the semi colon.
Forum: Plugins
In reply to: [dbview] DB ImagesThis usable SQL does not work for me either: `SELECT ID, ‘<img src=”https://www.google.co.uk/images/srpr/logo11w.png” />’ AS ‘ColB’
FROM wp_posts limit 2`I am not sure what’s wrong. If I use chrome inspect element, your HTML is there but greyed out. I think there maybe some level of anti HTML injection going on somewhere.
However this works, try a PHP snippet above the first column, your google image is displayed
return "<img src=\"https://www.google.co.uk/images/srpr/logo11w.png\" />";
This also works: try using the SQL
SELECT ID, ‘https://www.google.co.uk/images/srpr/logo11w.png’ AS ‘ColB’ FROM wp_posts limit 2
with the PHP snippet return “<img src=’$value’ />”;Forum: Plugins
In reply to: [dbview] Pagination Doesn't workI think that if you have put in your own LIMIT statement then the plugin will not append or edit your SQL statement. Try removing the LIMIT 20. There should be a warning to say that, apologies.
Forum: Plugins
In reply to: [dbview] Pagination Doesn't workThe ajax request is correct so I think something is going wrong on the PHP/server side. To make the paging work, the SQL statement is appended with LIMIT and OFFSET parameters. If you go into tools, there is a pre-installed dbview called
show all options
that displays the contents of wp_options table and the results should be paginated. Does this work for you? If yes I’d try a simple SQL query and make sure the results get paginated. Or just post up your SQL statement here and I’ll take a look.John