MyBB Community Forums

Full Version: This software is dope up until you want to dynamically change something
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I can't believe a lesser animal in simple machine forums has this down pat.

Can someone please explain to me how/why dynamically changing the html source for postbit avatar is so ridiculously stubborn?! I can't get it to work with my custom scripts because that postbit is tied down to that build function in that seperate file from the templates. >_< I'd have to integrate my code INTO mybb and work with its functions, etc. to get my mod to work in a timely manner and that means I have to first study someone else's programming style some and reverse engineer... that sucks. I don't want to sit there driving myself crazy wondering why someone programmed something I would do much differently. Why can't I just suppress some of mybb's code and be on my way?

Will someone who develops this forum please fix this... inherently it's no good. This is the first forum software I've come across where you have to fundamentally disturb the source for 'dynamic' showthread changes. I should be able to suppress code, alternate html, and change what it outputs depending what the user did to their profile with php at will. Not have go on a file hunt to see which code connects to what and then reconstruct a 500 piece jigsaw puzzle.. for not even a page worth of my own edits.

Seriously I'd have to rip some of the walls off the software to get my mod to work the way I want. I can't even really work with my included variables, I'm stuck with that predefined $post['avatar'] and since I can't use php there, my avatar changes would only be disappointingly static anyway.

What a huge disappointment overall, was liking this better than just about any board software I came across until I saw how tick pulling like editing the post profile template can be.

I hate the fact I seriously have to consider switching to something else to mod more freely after enjoying the aesthetics of this software and plugins - for weeks.
That's what plugins are for. You can't use PHP in templates as that poses a security risk.

MyBB 2.0 uses Twig which provides a more extensive templating system, but nothing will be changed until then. To rewrite the whole system now would be wasteful and illogical.

That plugin system works perfectly for extending MyBB to your needs.
(2012-02-29, 03:27 PM)Nathan Malcolm Wrote: [ -> ]That's what plugins are for. You can't use PHP in templates as that poses a security risk.

MyBB 2.0 uses Twig which provides a more extensive templating system, but nothing will be changed until then. To rewrite the whole system now would be wasteful and illogical.

That plugin system works perfectly for extending MyBB to your needs.

I can understand it on the end user side where you want to prevent code injection, but what's the problem with the Admin doing it from the cpanel (barring you don't have a weak password)?

I get that in the case you add on other admins it's a concern, but it looks like Admin Permissions could take care of that.

And no.. a plugin won't help me in this case as this mod of mine is unofficial and of my own making. I'd seriously have to 'get to know' the mybb way of programming things to implement it, and I just don't have time for that. I'd rather suppress a few lines of code and run (and of course audit it first) it.
what exactly do you want to use as the avatar image code? can you give us an example and perhaps we can give you some help. MyBB is really easy to use, you just need to get used to it.
(2012-02-29, 03:46 PM)pavemen Wrote: [ -> ]what exactly do you want to use as the avatar image code? can you give us an example and perhaps we can give you some help. MyBB is really easy to use, you just need to get used to it.

multiple external image files.

Hmm..

Here's a question, how can I add on to that $post array in postbit avatar in the template section?

I tried to add a secondary array to it in function posts.php but it didn't work, I think I'll do baby steps and just user define each new key... ah.. I doubt my array was the problem, the biggest issue I can't seem to overcome is proper poster propagation in showthreads.

I run my own queries and use variables like $mybb->user['uid'] to try and link the sql results to poster after poster with the correct uid, but it just doesn't work, as for one, I don't think I'm placing the query in the proper loop and I'm not chaining those id's right.. a big part of it is what you're saying.. I'm not used to the software and I'm trying to shortcut my a%# off due to time not being my friend atm lol, but seriously, the last forum software I used made this a cinch.
part of the problem is that the avatar system itself only supports single images, so even if you made the build_postbit function work with arrays of avatars, the user side would need a lot more work.

however, there is a site someone here posted here that does dynamic images for you. you sign up and load your avatar images and then you use the remote URL as your avatar on MyBB and it will randomly display one of your avatars. not sure if it is still around though, I did a basic search and could not find it.

i am sure there other sites out there that do the same basic thing thing.

(2012-02-29, 04:36 PM)pavemen Wrote: [ -> ]part of the problem is that the avatar system itself only supports single images, so even if you made the build_postbit function work with arrays of avatars, the user side would need a lot more work.

however, there is a site someone here posted here that does dynamic images for you. you sign up and load your avatar images and then you use the remote URL as your avatar on MyBB and it will randomly display one of your avatars. not sure if it is still around though, I did a basic search and could not find it.

i am sure there other sites out there that do the same basic thing thing.

just need to propogate the uid's correctly really. that way each poster's post profile would display the images.

problem i'm seeing is user tracking is kind of different with this forum.. like the user uid being unset when logged out lol, so that can't be the right white rabbit I'm chasing. would need to know how to do the id association from the post profiles in threads I think. I mean it's propagating there correctly..

and shet, I've been using php for 7 years and I still get amazed at how I can get as lost as wandering into a neighboring town looking at other people's work sometimes.

do you want the same random avatar used for a user for the entire thread or just the current page of the thread? the page is not that hard since you can keep the user info loaded for that instance, but on the next page, you loose that info and need to regenerate it.

check out my cpmuserlink plugin. you will see that it i grab the user info at the start of the page and then call it during the build_postbit() function. you can do similar via a plugin or with core edits. when the page loads, get all the users in that thread and preload all thier avatar data. in build_postbit function hooks, replace $post['avatar'] with the data you precompiled
(2012-02-29, 05:44 PM)pavemen Wrote: [ -> ]do you want the same random avatar used for a user for the entire thread or just the current page of the thread? the page is not that hard since you can keep the user info loaded for that instance, but on the next page, you loose that info and need to regenerate it.

check out my cpmuserlink plugin. you will see that it i grab the user info at the start of the page and then call it during the build_postbit() function. you can do similar via a plugin or with core edits. when the page loads, get all the users in that thread and preload all thier avatar data. in build_postbit function hooks, replace $post['avatar'] with the data you precompiled

?
MyBB uses hooks that allows plugins to perform operations at specific times or under specific conditions.

The functions_post.php file has a build_postbit function that actually generates the content for use in the postbit template. In this function, there is at least one hook (I don't recall exactly off the top of my head) that you can use to modify the postbit output.
Pages: 1 2