SimplePortal
Social => General Discussion => Topic started by: johncccccc on June 22, 2010, 05:38:32 PM
-
Hi,
Im trying to make a mod, but having a slight issue
I'm still learning PHP and SMFs layouts, so bear with me, please lol.
OK, without giving away the idea of my mod...
What makes the "Modify Message" link appear to only the member who posted the message?
I have been looking relentlessly and hardly found a thing. So far I have gathered its something to do with $memberContext + [$message['id_member'], but other than that I'm baffled.
Thanks for any help.
-
As long as you are adding code where the $message variable is defined (within the message display loop of the Display.template.php file), you can use the "$message['can_modify']" variable, which will be set to true if they can modifiy that post, false if otherwise. That link actually appears to moderators and admin, not just the origional poster.
-
OK thanks for the information..
What about if I were adding something after the signature, for that message?
would $message still be defined there?
-
Yes. That should work fine.
-
OK
Thanks for that information, saved me some time there.
So how exactly is the syntax to let a member (who made that post) see the object I want to add.
$message['what_goes_here'][are_there_anymore_required']
-
$message['member']['reference_to_your_permission']
Object-oriented programming isn't supported by SMF.
-
I got it working as follows:
if ($message['can_modify'])
echo 'MY stuff here ', then maybe some more PHP here , '';
Works fine, thanks for the help, its for a mod I'm currently working on :)
-
Great. If you need any further assistance feel free to ask.
-
Oh, more than likely I probably will.
Thanks
-
What mod is it? I'm curious..! :P
-
What mod is it? I'm curious..! :P
Well, I don't really want to disclose, you know, since I'm not as good at coding as many and my idea could easily get taken and packaged by a better coder, because I'm still coding for a long time to get my mod going,
Nevertheless, I think many will find this simple feature addition very useful, especially if you code a lot and like to announce process of certain things there up to.