MyBB Community Forums

Full Version: Customised database query and WPstyle shortcodes?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
(2015-11-03, 07:10 PM)Tom K. Wrote: [ -> ]Well  what kind of things would you want as a short code?


I would need database queries output please

 [sql f=forumID u=userID p=postID/value]  

then we can play around with the post loops in myCode
That would better (and only) fit as a plugin, it may also allow you to manage permissions, like only admins could -I hope- execute some SQL queries with different parameters.

It could be awesome in scenarios similar to this one :
- You have a forum/category dedicated to your published work (plugins / games / art etc.)

In your profile description you'd be able to say :

Check out my last works :

[sql f=1 u=24 limit=5 order=desc]


And it would turn into :

Check out my last works :

- Art Gallery v1.2
- Notification v3.0
- Wallpapers v1.1
- Permissions v2.0 Beta
- Yet Another v4.3
(2015-11-03, 08:23 PM)laie_techie Wrote: [ -> ]
(2015-11-03, 03:54 PM)expat Wrote: [ -> ]well you cannot output database queries unless you modify it as a core myBB code

And i didnt link to it anyways, but shortcodes are shortcodes without closing tags

Doable as a plugin. You just need to register a function to use the parse_message hook and have that function do the db query and replace the tag with whatever you want.

Agreed. I think this makes a lot more sense as a plugin. It's already pretty easily doable (and I have some set up on my board) with a plugin, and I don't think it needs to be in the core.
well its so doable thats why it should be in core....there is the lastests post on the index, and the portal announcements and latest threads....

would be nice to have a plugin that sets up the the queries in the ACP: forums, users, prefixes, and any other filters, and the shortcode should just identify the queries shortcode ID

 {shortcode query= 1}
(2015-11-11, 04:12 AM)expat Wrote: [ -> ]well its so doable thats why it should be in core....there is the lastests post on the index, and the portal announcements and latest threads....

Not everything that is easy and doable should be in core; we need to determine what is useful to enough users to incur the technology debt maintaining it.

(2015-11-11, 04:12 AM)expat Wrote: [ -> ]would be nice to have a plugin that sets up the the queries in the ACP: forums, users, prefixes, and any other filters, and the shortcode should just identify the queries shortcode ID

 {shortcode query= 1}


The problem is that each shortcode query has different parameters. Query 1 might be a list of posts, but you still need to indicate which user, which forum, the number of posts to include, etc. Without that information, what happens when someone quotes a post which contains the shortcode? And do you really want to force your users to memorize the ID of the various shortcodes?

And if there are standard shortcodes, why not give them their own MyCode? No one said that a MyCode has to have an ending tag.

[gallery user=laie_techie]
hahaha, its a Admin tool, its not for users to play around and hack into your database, and security is why it should be in Core
Pages: 1 2