I'm not familiar with VB, only got my hands on it recently. I'm wanting to create a hack, with phpBB I know I had to change the php code and could have done something that way. Now VB looks totally different, I heard that plugins could be created this way they still exist after an upgrade. The hack I want to create has a simple logic, and that is to show the most recent member who has made a post in the "newest member" at the bottom of the page. If it was phpBB I would added something like WHERE posts > 0 Code (markup): to the source whereas with VB I dont know where to start.
You need to be more specific. Is "Newest Member" a sub-forum, or? What page do you want to show them on?
Newest member is on the main page at the bottom, y'know "Welcome to our new member, username". I want to show someone who has posted and not just registered
Make a plug-in with a hook location of forumhome_complete. Query the data you want (I don't know the SQL query needed off the top of my head) and make the user name you want set to $newusername.
Oh f^*k, don't know eff all about this. Will go mess around with it and prolly watch it blow up in my face ... Do I need to use OOP?
Okay, that's wrong... I was close though. Forgot about query_first... anyway, here's the plug-in (you can just upload the XML file as a plug-in... NOT as a product).
I tried your first suggestion a few times, modifying it aswell to match the table name by adding the prefix and putting brackets in etc - was about to post that I cant get to work and saw your post. Ah cant this to work either, uploaded it no problems, shows up in the plugin manager. All the code seems correct, eg table and field names. I am thinking the VB source code needs changing because what we generate is probably replaced by thier code, no? I dont know what else...
Fuggity fugg, what a dopey dope I am. I assumed the last sentence there would switch it on, but no so have done it now and it works except the member?u= id is incorrect. Will look into it. I'm telling ya, you are the BOMB
Cant get the userid to work on the url this is what I got $newusername = $db->query_first("SELECT userid, username FROM `PREFIXuser` WHERE (`posts` > 0) ORDER BY `userid` DESC LIMIT 1"); $newusername = $newusername['username']; $newuserid = $newusername['userid']; PHP:
*Must remember to refresh before posting* Excellent, its all working now! How come the one I did didn't work? Is it because I had the userid as the last line instead of the username? And how do you know so much about VB, like what to name the variables? I wouldnt know where to start. This was my first shot at the plugin thingy and from my first experiance doesnt seem extremely difficult.
The one you did didn't work because I was reusing a variable. You ended up destroying the array with the userid in it before you got it (was just execution order). I just look at the PHP source code to figure out the hook name and variables. For example if you look towards the end of the main file (index.php), you can see the variable names and hook name. So for simple things like that it's no biggie.
I seriously need to get a book on PHP. Dont understand what you mean there, the only difference I am seeing is the $newuserid being fetched before $newusername. I've swapped these two lines around just to test and realised it only works when $newuserid is first. I see what you mean by variable names, I might aswell comment them out in index.php (right?) because this way those two queries are running when there is no need. Promise I'll stop asking questions after this one
No point in commenting them out in the PHP file... They don't require a query to begin with so the overhead of setting a variable wouldn't even be measurable. Plus the point of plug-ins is so you don't have to edit your PHP files.