I followed the required steps to upgrade from phpversion 7.4 to 8.1, but get the following error messages on the plugins “DBview” and “Formmaker”:
Fatal error: Uncaught Error: Non-static method DBViewPublic::getDefaultViews() cannot be called statically in /var/www/vhosts/lasermasters.nl/httpdocs/wp-content/plugins/dbview/DBView.class.php:118 Stack trace: #0 /var/www/vhosts/lasermasters.nl/httpdocs/wp-includes/class-wp-hook.php(308): DBViewPublic::activate() #1 /var/www/vhosts/lasermasters.nl/httpdocs/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters() #2 /var/www/vhosts/lasermasters.nl/httpdocs/wp-includes/plugin.php(517): WP_Hook->do_action() #3 /var/www/vhosts/lasermasters.nl/httpdocs/wp-admin/plugins.php(194): do_action() #4 {main} thrown in /var/www/vhosts/lasermasters.nl/httpdocs/wp-content/plugins/dbview/DBView.class.php on line 118
Fatal error: Uncaught Error: Call to undefined function create_function() in /var/www/vhosts/lasermasters.nl/httpdocs/wp-content/plugins/form-maker/form-maker.php:268 Stack trace: #0 /var/www/vhosts/lasermasters.nl/httpdocs/wp-admin/includes/plugin.php(2314): include_once() #1 /var/www/vhosts/lasermasters.nl/httpdocs/wp-admin/plugins.php(192): plugin_sandbox_scrape() #2 {main} thrown in /var/www/vhosts/lasermasters.nl/httpdocs/wp-content/plugins/form-maker/form-maker.php on line 268
do you know a solution for these two errors?
]]>It would be nice if the number of lines displayed were adjustable, either by the admin or by the user when viewing the page.
]]>Would it be possible to allow the user to sort on more than one column? For example, given 3 columns, if I click column C, then column A, it would be nice to have the results displayed as if the query was done with “ORDER BY A, C”
]]>Hello John,
you did dbview 5 years ago.
Do you have any plan to do a new version?
Or is it closed?
Best Regards,
Gerhard
Hello.
I have a startpage without any DBviews and 2 other pages with dbviews.
When the startpage is loaded all views of one of the other pages are loaded, which I do not want.
Why are only the views of one page loaded and not both (I don’t want any to be loaded.)
Best regards,
Kees Bond
]]>Hi, I want to pass a simple form value to another page that has DB view. My form page looks like this:
<form action=" https://www.westsuburbanlittleleague.com/schedule.php" method="post" name="contact form">
<table width="100px">
<tbody>
<tr>
<td valign="top"><label for="division">Division</label></td>
<td valign="top"><select name="division">
<option value="MAJ">MAJ</option>
<option value="INT">Intermediate</option>
<option value="MIN">Minors</option>
</select></td>
</tr>
<tr>
<td style="text-align: center;" colspan="2"><input name="submit" type="submit" value="Submit" /></td>
</tr>
</tbody>
</table>
[Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been damaged by the forum’s parser.]
I want to pass division to:
[dbview name=’MAJSchedule’ pagesize=10]
How would I do that so it only queries the Division?
]]>Hi, thanks for a great plugin.
Been using this, but it appears that the shortcode only works in post/pages, I’m trying to use the shortcode for my plugin but it’s not rendering the table, it just print the shortcode itself. Thanks in advance for help. I’m a beginner in WP, so if I’m missing something please tell.
Can I show vertical table instead of horizontal table?
Is any shortcode to do it? or other way to do it?
please kindly help.
This is a very good plugin. Thank you very much!
Is any way to change the table title? since it display the database title name for each column, but I would like to change it and the database column name remain unchange.
Hi, thank you for creating this plugin. It is great!
I did the follow code and it shows all the information of all user, but it is not what I want. I want to display only the info of the current user.
Could you please let me know what I did wrong?
<?php
global $current_user;
get_currentuserinfo();
$user = $current_user->user_login;
$email = $current_user->user_email;
$id = $current_user->ID;
echo $id;
echo do_shortcode(“[dbview name=’UserCar’ arg1=$id]”);
?>
Remarks:
UserCar Database has a column “UserID”.
Is there a way to set variable cell background colors by data?
For instance if the data returned by the query for a given column is either STOP, SLOW or GO can I set cell background as follows?
STOP = RED
SLOW = YELLOW
GO = GREEN
Any help would be appreciated.
WHAT I MUST CHANGE IN THIS:
$u=wp_get_current_user();
echo do_shortcode(“[dbview name=’show user’ arg1=$u->ID]”);
The corresponding SQL stored in ‘show user’ is:
select ID, user_login, user_email, user_registered, user_status
from wp_users where ID=%d
IF I WANT TO USE ‘user_registered’ AS FILTER.
I WANT TO FIND THE USERS WHO REGISTERED THE SAME DAY WITH THE LOGGED USER.
Thanks again for your awesome plugin & support…
Is there a way to pass the “page (or post) title” through to the SQL Query?
example:
Select X,Y,X from ‘my_database’
where X= ‘POST_TITLE’
This would allow me to use the same shortcode on many different pages, instead of writing a unique for each different post (over 300 total!). I saw another thread in this forum in which you suggested downloading the plugin “Post Snippets”, which I’ve done, but couldn’t really figure out how to make it all work from there.
Thanks,
Joe
Apologies if this has been addressed, though I couldn’t follow some of the previous related threads…
I have a database with one field that contains ‘affiliate links’ to amazon. I’d like to get these to display as clickable links in my table, which open to a new window…
Here’s an example of the html that Amazon gives me to use:
The Four Who Entered Paradise: A Novella<img src=”https://ir-na.amazon-adsystem.com/e/ir?t=radrezlaa34h-20&l=as2&o=1&a=0876685793″ width=”1″ height=”1″ border=”0″ alt=”” style=”border:none !important; margin:0px !important;” />
Currently, the rest of my table displays fine, but this field just appears as text… Any ideas how to get it to display & open link in a new window?
Here’s a page from my site that shows the table in action currently..
https://rabbilabaton.com/link/
Thank you,
Joe
Is it possible to hide the header?
I am hoping to put a number of short codes on the same page, and I want to use a smaller header which I could possibly insert in the page.
John
]]>is there anyway to add search function for the table?
]]>John – great plugin. I’m using it to query user input data and return a result on the front end. Pretty simple queries: total # of registered users, and total weight lost (for a health/weight loss community site). Wondering if there’s shortcode (or a tweak) to disable the table output and simply show the single resulting number (in a sidebar text widget). The site is https://thecrusade4health.com. All sub-pages contain the sidebar. Thx.
]]>Hi John,
after some playing with your plugin, i missed the capability to input parameters to a dbview from input elements on a page. Interactivity is what users often want.
So i looked into your Javascript code and after some refactoring and some additional jQuery magic i finally managed to get something like this working:
<!-- Basic input of searchtext with Submit-Button -->
<div>
<input id="dbviewinputarg1" name="Eingabe" type="text" />
<button class="dbviewformbutton" type="button">Search</button>
</div>
<!-- the original unchanged dbview shortcode with initial values for arg1 and arg2 -->
[dbview name='Volunteerliste2' pagesize=50 sort='user_registered' order='desc' arg1='%' arg2='%']
On initial startup of the page, the arguments in your ShortCode are taken and the dbview loads. When you then enter some searchtext in the input control and press the Search Button, the parameters are taken from the form an thus some interactive filtering is possible.
If you are interested in the changes i made, just drop me a line and i’ll be happy to send the changed code over to you.
IMHO this makes the plugin so much more useful.
Cheers,
Joe
Hi John,
first of all: Thanks so much for this great plugin.
I’m playing around with it, because i want to use it for listing portal users and display their custom profiles (managed by UsersUltra plugin).
Everything seems well, except one thing:
The plugin doesn’t seem to persist the “Column sortable” settings. I cannot get any Column Header to become sortable.
I looked into the wp_options table to see how the view is persisted and it looks like this:
2825, ‘dbview_Volunteerliste’, ‘O:6:”DBView”:7:{s:7:”version”;i:1;s:4:”name”;s:14:”Volunteerliste”;s:5:”query”;s:254:”SELECT CONCAT(‘/wp-content/usersultramedia/’, ID, ‘/’, m.meta_value) as Avatar, ID, user_login, display_name, user_email, user_registered FROM wp_users w left outer join wp_usermeta m on w.ID=m.user_id and m.meta_key=’user_pic’ where w.user_status=0″;s:10:”columnName”;a:6:{s:8:”username”;s:8:”Username”;s:10:”user_login”;s:8:”Username”;s:12:”display_name”;s:11:”Anzeigename”;s:10:”user_email”;s:5:”Email”;s:15:”user_registered”;s:14:”Registriert am”;s:11:”user_status”;s:6:”Status”;}s:14:”columnSortable”;a:0:{}s:12:”cellFunction”;a:1:{s:6:”Avatar”;s:56:”return (‘ <img width=”100″ src=”‘ . $value . ‘” />’ );”;}s:6:”public”;b:1;}’, ‘yes’
There doesn’t seem to be much information related to the columnSortable element.
Any ideas?
As i need this in a current project, and i appreciate your work, i’m willing to donate a fair amount if you get this fixed soon.
I’m running WP 4.1.1 on a windows server, just in case you need to know.
Thanks,
Joe
Hallo ,
i have the problem the mysql query should give the data of the current user , but i get the data of all users
i have this code
DB View:
select LastLogin from User where Nickname=%d
in php snippet:
$u=wp_get_current_user();
echo "UserData" ; echo $u->user_login;
echo do_shortcode("[dbview name='Gravity_data' arg1=$u->user_login]");"
if i change in DB View the Nickname to a exist name it works.
but the php snippet i think do_shortcode do not sent the user_name.
or make the var empty.
the line
echo “UserData” ; echo $u->user_login;
gives a right username back.
can anybody help ?
]]>I have another database on the same server that I would like to use your tool for.
This other database can be accessed remotely, but I need to the show data in my WP site – and your tool does all I need, if I can just run it off this second set of data.
My second database is $newdb.
I really only want to show tables with your Tool from the 2nd database, not from the main WP database (or both), if that makes it any easier.
Thanks in advance for any tips
]]>I would like to give the use the option to export or print the sql results shown in the dbview. Is there a way to do so?
]]>I made the ID fields in the dbview table Clickable Links. When clicked, the ID ($value) is passed to another dbview view.
I am using the plugin PHP Snippets. The PHP Snippets encapsulates the code as a shortcode that one can place on a page. I would like to capture the ID that was clicked in the dbview so I can pass it to PHP Snippets. I placed the following the in dbview for the ID hoping to trigger the PHP Snippets shortcode with no luck.
do_shortcode(“[printAttendeedetailList name=$value]”); The printAttendeedetailList is the PHP Snippets shortcode.
Is there a way to call a shortcode in the dbview PHP area? What would you recommend?
Thanks for your time.
]]>Thank you for a great plugin.
I created a dbview that provides a list of items. I made one of the fields in that view a hyperlink (e.g Item ID). When Item ID is clicked, another dbview is executed showing the detailed information related to this Item ID. Here’s the code and it works wonderfully.
“$name“;
return DBView::link($value, “ItemDetail”, $value);
Is there a way to open the second dbview (in my case “ItemDetail”) in a separate Window. Also is there a way to give the user the ability to go back to the previews dbview allowing the user to click another Item ID to view its information?
Thanks again for your hard work and for a great plugin.
]]>Thank you for creating the plugin. When I place the shortcode (mine or any of the ones that come out of the box) on a wordpress page, the table and its values do not show. However, in the setting of dbview, the values are shown for any of the view.
The firefox console shows the following:
ReferenceError: dbview is not defined jY5REoMgDEQvJFBHL4QxRRRICrEtty926H-_sjs7uy-T2R8n5jpMXajoXbaCOvo0zOYUH8pXj-ZuAReiQ7F1qHgjIeVsCK1l9tLiBHWhdx_SP69GPelZs4XjjxFm17BAMWISlZFD7fh1eXp89dO8I3IBFVgW2OxVLpA9y3AzsZb2NxqfIJwrliuUzee1UbPUDw.js:21
ReferenceError: thickboxL10n is not defined dY_hDoMwCIRfSCWLvlAtpFZb6WiJ29vPqHFbov-A7-5ytKAexqeSvBv1jWWhJvq5av_vi0dH5YpE1nxpySzF9OGSoRjn7iGndAczBbLf3A7K4O3U8-scqiXVBlcIYwZCX1gOqc5Iks8XO8jD2tEy7vuvL65GU2sKbPAQb6zuzZ72gJFKMnaCyKiBMizJCQ_8AQ.js:37
TypeError: h is undefined lY1BEoIwDEUvJI0duA_TdiKmlrQ2ReX2FpCVbFhl8n_eiwZ8IZcm40BSsikUuUa5T5MN5HpxmVK56KMzF0PMNn7AC_jnhHlWe3QMbDKBm2E3r-BG7XujVas6lYx7nBOgEeJhxc_DY5wE33fE0LTquv_vwNZhI6MaiavRY1kK6IkdSPrPfrql-gI.js:85
TypeError: Backbone.Model is undefined notes-common-v2.js:32
ReferenceError: _ is not defined admin-bar-v2.js:2
TypeError: dbview.busy is not a function jY5REoMgDEQvJFBHL4QxRRRICrEtty926H-_sjs7uy-T2R8n5jpMXajoXbaCOvo0zOYUH8pXj-ZuAReiQ7F1qHgjIeVsCK1l9tLiBHWhdx_SP69GPelZs4XjjxFm17BAMWISlZFD7fh1eXp89dO8I3IBFVgW2OxVLpA9y3AzsZb2NxqfIJwrliuUzee1UbPUDw.js:17
Use of attributes’ nodeValue attribute is deprecated. Use value instead. 982-2
Use of getPreventDefault() is deprecated. Use defaultPrevented instead. jY5REoMgDEQvJFBHL4QxRRRICrEtty926H-_sjs7uy-T2R8n5jpMXajoXbaCOvo0zOYUH8pXj-ZuAReiQ7F1qHgjIeVsCK1l9tLiBHWhdx_SP69GPelZs4XjjxFm17BAMWISlZFD7fh1eXp89dO8I3IBFVgW2OxVLpA9y3AzsZb2NxqfIJwrliuUzee1UbPUDw.js:3
Any idea? I am using WordPress 3.7.4
]]>Hi, I really like the look of dbview. I would love to be able to use it better.
I have multiple tables, which can be seen here: https://matthewpetty.com/theatrics/theatre-database/list-of-all-theatre-groups/
The password is “dbview”
The tables represent my amateur theatrical career. One table shows theatres, another shows theatre groups, another shows roles etc.
Each table has a unique ID in one of the columns, so it should be easy to link.
What I would love to do is show a list of theatres, and to be able to click on a theatre and see a list of performances at that theatre. Similarly, I want to show a list of groups, click on a group and show a list of performances with that group.
I’ve tried to understand the FAQ, but I can’t seem to get it to work. I don’t understand what I need to do.
What should I put in the view SQL definition, the dbview tag, the args. Where would I put the PHP?
I would be very grateful if you could walk me through this.
Best regards,
Matthew
I’m using the following snippets
$a = explode(“,”,$value);return “<img src='”.$a[0].”‘ />”;
and
return ”;
works a treat, but it opens the link in the same window, I have tried to add a tag to open in a new window but can’t get it to work, please help.
thanks again.
]]>Hello,
I have a question, I am trying to use a UNION on 2 queries but I get a 406 error every time. If I run them both separately they are fine. If I add the UNION then it errors.
is there a way around this?
thank you
]]>Is there a way to set column widths for individual columns?
]]>I am able to extract information with a short code similar to:
[dbview name=’world cities’ sort=population order=desc]
Is it possible to have a similar shortcode whereby I could count the number of rows in the above shortcode.
Thanks.
]]>