Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=1554)
Post and Change as Alternate User by BurkeKnight EnterprisesVersion: 1.5 Date: December 10, 2008
Compatibility: SMF 1.1.x
Made by: BurkeKnight (http://www.simplemachines.org/community/index.php?action=profile;u=150637) - BurkeKnight Enterprises (http://www.burkeknight.com/)
This mod combines these mods:Change Poster Of Message And Topic
Post As An Alternative User
Important!!!: You should uninstall the following mods if installed, before installing this mod:
Admin Can Post As An Alternative User
Change Poster Of Message And Topic
This modifications gives admins a possibility to change the poster of the message.
When a message is being modified by the admin, a checkbox for enabling the feature
and a textbox for entering the change poster id appears under the Additional Options.
This mod changes all needed information of poster. Also if the post is the start of a topic,
it also changes the topic as post.
This modification also adds the feature of posting as an alternative user.
While posting, a checkbox for activating the feature and a textbox for the user
id to post as is appeared under the Additional Options for the user who has the needed permission.
If the user id is left blank or set to zero the post is sent as a guest named "Forum Staff".
You can give the permission from: Admin CP >> Permissions
Credits:Change Poster Of Message And Topic taken over by BurkeKnight Enterprises (http://www.burkeknight.com/) from [SiNaN].
Post As An Alternative User Mod is originally coded by karlbenson and taken over by [SiNaN], then taken over by BK Modding.
Support:If need support for this mod, please go to BurkeKnight Enterprises (http://www.burkeknight.com/) and register there.
We have a support ticket system for mod support.
We will no longer be supporting this mod here at the SMF site,
as we feel it is easier to keep all support at our site.
Changelog:December 10, 2008:
Change Poster Of Message And Topic & Post As An Alternative User mods taken over by BurkeKnight Enterprises (http://www.burkeknight.com/).
Both Mods combined for use with SMF 1.1.x Line.
(http://i.creativecommons.org/l/by-sa/3.0/88x31.png) (http://creativecommons.org/licenses/by-sa/3.0/deed.en_US)
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License (http://creativecommons.org/licenses/by-sa/3.0/deed.en_US).
change topic starter have no option to " 0 " like the edit function Post/Edit As Alternative User.
Is there no input for this or was is not build in?
The two combined is not strange to do, the function is almost similar.
SiNaN thank you for this mod, and BK thank you for maintain the mod
and combine the two in one package.
8)
You can post as "0" to begin with, which will show as "Forum Staff"
However, you can not change a post to "0"
You can change to any other member.
Ah man and I was just about done with a 2.0 conversion for these. :(:)
Gratz and good luck BurkeKnight
Any update for 2.0 beta 4 . thanks in advance.
Question:
Will this mod be made for SMF 2.0?
Answer:
We are developing a SMF 2.0 Beta 4 version.
Question:
When will it be released?
Answer:
When it is done, and tested extensively. No sooner, no later. :P
Quote from: Garou on December 18, 2008, 08:47:31 PM
Ah man and I was just about done with a 2.0 conversion for these. :(:)
Gratz and good luck BurkeKnight
You may want to help BurkeKnight here (http://www.simplemachines.org/community/index.php?topic=280379.msg1839700#msg1839700) then.
How can I install it on a custom theme?
Go to the Mod page, and where you download it, it has a way to see installation for the version of SMF you are running.
Also:
Manual Installation of Mods (http://docs.simplemachines.org/index.php?topic=402)
Thank you BurkeKnight,
I was waiting for such a long time for 2.0. 4 compatibility.
As you have mentioned we will wait for it.
Really Great and very usefull Mod
thanks ;)
Hello,
Glad to see the function merger done officially, as I manually tweaked to get both installed.
Which leads to my current problem... I am trying to back the old versions out, which will require me to manually edit ./Themes/default/Post.template.php to clean out the code. Except, [SiNaN]s original MODs are no longer available, and I can't use the "Manual Install Instructions" to reference.
Any chance you or Blue Dream could remove the code if I attached my Post.template.php file (the other files appear to be accepted without error for uninstall when I test uninstall)?
Grazie
Cal
Attach it.
Quote from: Blue Dream on January 10, 2009, 05:30:02 AM
Attach it.
I was waiting for such a long time for 2.0. 4 compatibility.
/me is not sure how the 2.0 version has anything to do with the quoted text.. :P
I am working on a 2.0 version, however, there are issues being worked on, including my PC having issues, and rebuilding it as soon as parts arrive....LOL
Then, dev work on my mods will continue. :)
Blue Dream,
File attached.
Grazie Mille!
Cal
Hello,
Hate to be a bother as this is a favor on your part, but would it be possible to look at clearing the two old separate MODs out of my Post.template.php file? I'm presuming I'll tell both MODs to uninstall, ignore their error on my current post.template.php file, and then replace my existing one with the cleaned up one.
Your help on this is greatly appreciated.
Cal
hi ive installed this and want to know how i can add the option to the administrator permissions please.
Administrator permissions are set to all permissions in SMF.
Nothing to set in this mod for Admins.
Unless, it is a 2nd Admin membergroup, and the setting for this mod is only for post as alternative in the membergroup permissions. However, I do say to watch out who you give this ability to.
Hello,
I appreciate your very kind offer to scrub my post.template.php but I was wondering when you might be able to work on it? I'm holding off on any MODs that want to touch post.template.php.
Grazie,
Cal
Sorry if this is a dumb question, I am new to SMF, but how do I know what to put in the "poster ID" and "Alternative User ID" boxes? I want this feature, as I had something similar on my phpbb3 forum, but I guess I just don't understand how it works.
The member's ID number.
This can be found in the admin section, looking at list of members, or via the regular member list.
The end of the link to the member's profile, will end in something like:
u=62
62 would be the ID. :)
Thanks! :)
Is it just me, or do the post counts not get updated when the posting member is modified.
It would be a more complete update if the post stats were increased by 1 for the member being made the poster of the topic and decreased by 1 for the the member who is no longer the poster for the topic.
I installed this, passed the test but now this is at the top of my forum, ersion 1.8:
$txt['changeposterid'] = 'Change Poster/Starter'; $txt['changeposteridno'] = 'Poster ID'; $txt['adminscanpostasaltuser'] = 'Post/Edit As Alternative User'; $txt['adminspostasguestcalled'] = 'Forum Staff'; $txt['adminscanpostasaltuserid'] = 'Alternative User ID';
How do I get rid of that?
I have not checked this mod with 1.1.8 yet. It looks like the text strings may have been changed a bit.
I'll look into this a little later.
Quote from: floydpink on February 05, 2009, 02:30:02 AM
Is it just me, or do the post counts not get updated when the posting member is modified.
It would be a more complete update if the post stats were increased by 1 for the member being made the poster of the topic and decreased by 1 for the the member who is no longer the poster for the topic.
Nope, not just you... changing the post count of the old/new user is not increased/decreased. I have literally thousands of posts which have been and need to have the IDs changed due to having to manually transfer posts from MSN groups, so it's a very important issue for us.
It would make sense that this function should be included in the mod or as a sparate mod, not just for a change to "guest", but for all poster ID changes:
Add/subtract 1 to/from changed ID poster.Does this exist somewhere or can it be provided?
Thanks ~ Phåråoh ~
So is this ok to install and run on 1.1.8? I installed this on one of my 1.1.8 test boards and it seems to work as advertised. I received no errors during install and no text showing on my forum as mentioned above. I can post as a different user and all post counts go up afterwards. Should I be safe running this on my actual board?
Such an excellent mod.
Waiting for updated version of it on 2.0 RC1.
Just a request.
I want to install this MOD, replacing the preceding seperate MODs.
Unfortunately, I get errors trying to uninstall from post.template.php. The original MODs have been removed from the Mod site. many weeks ago I asked if someone could help strip the MODs out of the file. I was asked to post my php file, which I did. There has been no response to my requests since then.
Would you be able to pull them out so I can install properly? I'm running on 1.1.8.
Grazie,
Cal
Quote from: stingerman on February 08, 2009, 06:30:28 AM
I installed this, passed the test but now this is at the top of my forum, ersion 1.8:
$txt['changeposterid'] = 'Change Poster/Starter'; $txt['changeposteridno'] = 'Poster ID'; $txt['adminscanpostasaltuser'] = 'Post/Edit As Alternative User'; $txt['adminspostasguestcalled'] = 'Forum Staff'; $txt['adminscanpostasaltuserid'] = 'Alternative User ID';
How do I get rid of that?
Having the same problem here, I guess it has to be something about my Theme Post.template.php
I'm attaching it.
Using vintage Theme with SMF 1.1.8
www.pearljamexico.net
Tnx in advance
Quote from: A.SK on March 08, 2009, 10:47:30 AM
Such an excellent mod.
Waiting for updated version of it on 2.0 RC1.
Just a request.
2nd that! ;D
Quote from: ThePharaoh on March 14, 2009, 07:56:55 AM
Quote from: ThePharaoh on February 21, 2009, 08:45:30 AM
Quote from: floydpink on February 05, 2009, 02:30:02 AM
Is it just me, or do the post counts not get updated when the posting member is modified.
It would be a more complete update if the post stats were increased by 1 for the member being made the poster of the topic and decreased by 1 for the the member who is no longer the poster for the topic.
Nope, not just you... changing the post count of the old/new user is not increased/decreased. I have literally thousands of posts which have been and need to have the IDs changed due to having to manually transfer posts from MSN groups, so it's a very important issue for us.
It would make sense that this function should be included in the mod or as a sparate mod, not just for a change to "guest", but for all poster ID changes:
Add/subtract 1 to/from changed ID poster.
Does this exist somewhere or can it be provided?
Thanks ~ Phåråoh ~
v1.1.7 Question is still open
Perhaps this (old) mod Member post recount (http://custom.simplemachines.org/mods/index.php?mod=561) could help?
What would make this mod even better would be the ability to mass change who posted something. Not sure how you would finagle that one, but I am running into that problem right now. It sure would make things easier. Editing each and every single topic is tedious.
8: Undefined index: changeposterid
File: /Themes/default/languages/Post.english.php (main sub template - eval?)
Line: 614
Getting that error whenever I modify a post. Any ideas?
Waiting for updated version of it on 2.0 RC1-1. :D
Hello all,
in the attachment ist the modified MOD.
This work under SMF 2.0 RC1. SMF 2.0 RC1-1.
@BurkeKnight: You can use this do update your mod and upload it into mod database. ;)
Kind regards,
TheDeath
Quote from: TheDeath on June 25, 2009, 05:40:21 PM
in the attachment ist the modified MOD.
This work under SMF 2.0 RC1. SMF 2.0 RC1-1.
On SMF 2.0 RC1-1 it work as advertised, thanks! :)
Quote from: TheDeath on June 25, 2009, 05:40:21 PM
Hello all,
in the attachment ist the modified MOD.
This work under SMF 2.0 RC1. SMF 2.0 RC1-1.
@BurkeKnight: You can use this do update your mod and upload it into mod database. ;)
Kind regards,
TheDeath
Thanks
it will work on 2.0 RC1-1 :D
Has someone taken over this mod? I see that the mod author was last active Feb. 2009 from the original post profile and the other account later on in the thread.
TheDeath updated it for 2.0 with the intention that BK will update his files.
Several months back BK asked me to come to his site and work on it as part of his team as I had been in contact with SiNaN about taking it over when he officially gave the two mods up but gave them to BK instead, I declined. Other then that there has been no official word that BK was giving them/it up.
Edit: I did some research and it looks like BK's site has been suspended for some reason and the other sites Ive known him to be associated with, he hasn't logged into since February either. I'm not sure what that means for the future of this mod or his others. :-\
Well on a side note, I hope he/she is well.
Quote from: C4G-TK on June 28, 2009, 10:38:55 PM
Has someone taken over this mod? I see that the mod author was last active Feb. 2009 from the original post profile and the other account later on in the thread.
That was the reason why I've changed self and there are a lot more mods which do not go for SMF2.0.
I saw your post and will try out the update today.
I asked the question because I like to have a print out of the parse for my specific edition of SMF. I do this for every mod that I install. I'll just print out the xml file or something. (I know... I'm kinda anal like that.) Also, I like to know if something is still being supported by the author or not. That's all.
Thanks for the update to the mod. I'll try it since it was a mod that I had on a previous 1.1.X site, but have waited for an update for 2.0. Thanks again!
source/subs-post.php gives error
I show in my crystal ball but i can't see your error. :o
I will change but no code in it....
I can not help you, when you not write code or the error message.
Sorry I have mistake...
soruce/post.php
I have changed it but there is an error :
Parse error: syntax error, unexpected T_ELSE in /vhosts/mysite.com/http/Sources/Post.php on line 1879
Here it is the file....
Thanks TheDeath
It works good for my 8)
SMF 2.0 RC1
Quote from: akbora on June 29, 2009, 03:33:03 PM
Sorry I have mistake...
soruce/post.php
I have changed it but there is an error :
Parse error: syntax error, unexpected T_ELSE in /vhosts/mysite.com/http/Sources/Post.php on line 1879
You have all copy and paste ;).
You can found the repair post.php in attachment.
Wooouwwwwww!!!!! Thanks thansk wonderful!!! Thank you billion times....
Very very useful mod and we need it really...
No problem 8).
You're right, it's a really good mod
I'd like to switch to this MOD, but I have the two original MODs on my system and they've been removed from this site so I can't manually extract them (helps to know what to take out). And posts to the original topics have not gotten a response.
*sospiro*
Cal
I can try to help you.
I need the files from your mod's and the files which the mod's have changed.
What version of SMF have you?
I'm on 1.1.9. I'll see about running the uninstall on my site to see what files fail. I think it's just one php file that's having problems uninstalling.
Will attach tonight (GMT-7).
Grazie!
Cal
http://sleepycode.com/PackageParser/index.php go to this site and upload the package you have on your server and it will tell you what code you need to change. On a side note it usually best to uninstall mods before upgrading smf.
Garou,
Thanks. I looked at that, trying each MOD separately. However, merging [Sinan]'s two MODs manually, I managed to merge the code so uninstalling requires a bit more surgery than I'm comfortable with. I've had no problem, when trying to add a MOD, of using the parser on the MOD page to locate the string it wants and moving code around manually so that the install works. In this case, so much of the code overlapped it's not easy to pull apart at my level of php (PL/1 or REXX would be another matter entirely ;) ).
TheDeath,
So, I'm going to attach my two MODs and my Post.template.php and perhaps the code from the two MODs can be extracted. I can then run the uninstalls, ignore the errors for Post.template.php, and then replace Post.template.php with a clean version so I can install this MOD.
Many thanks all around.
Cal
Cal O'Shaw, at line 591
Find...
</tr>' : '';
if (allowedto('reply_alternate'))
{
echo ' <tr>
<td class="smalltext"><label for="check_postasforumstaff"><input type="checkbox" name="postasforumstaff" id="postasforumstaff" value="1" class="check" /> '.$txt['adminscanpostasaltuser'].'</label></td>
<td class="smalltext"><label for="text_staffid">'.$txt['adminscanpostasaltuserid'].': <input type="text" name="staffid" id="staffid" size="5" /></label></td> </tr>
<tr>
<td class="smalltext"><label for="check_changeposterid"><input type="checkbox" name="changeposterid" id="changeposterid" value="1" class="check" /> '.$txt['changeposterid'].'</label></td>
<td class="smalltext"><label for="text_changeposteridno">'.$txt['changeposteridno'].': <input type="text" name="changeposteridno" id="changeposteridno" size="5" /></label></td>
</tr>';
}
echo ' </table>
</div>
</td>
</tr>';
Replace with...
</tr>' : '', '
</table>
</div>
</td>
</tr>';
That will remove the mods from that file. If you have problems with any other files let me know.
Garou,
Grazie!
I've switched over to this MOD and have asked one of the Global Moderators (to whom I have given access to this feature) to see if it works now for that membergroup.
The only change I had to make was your replacement code didn't have the same number of spaces as the package was looking for. So I just went to the MOD page, parsed it, and pasted its replacement over yours. Boy that parser is picking with white space :).
TheDeath,
Grazie to you for your help on this and other past items.
Quote from: Cal O'Shaw on July 02, 2009, 12:34:55 AM
Boy that parser is picking with white space :).
Indeed it is, Glad it all worked out ok for you though :)
Got a problem, though...
As Admin I can use it. Despite giving the ability to my Global Mod group, they do not see the option (I even logged in on an account set for that group, so it is a real problem). No errors were reported for installation.
Grazie
Go to Admin Panel.
Under Members -> permissions, click modify by the group Global Moderator.
Scroll to "Default Board Profile Permissions", under Post you find this point "Can reply as an alternate user", check it and save.
Kind regards,
TheDeath
Hello,
Actually I had already done that. One of the previous MODs this MOD was built upon used that control. I went to the permission page after I had installed the MOD, found it was already checked (from the old MOD), so I unchecked it, saved it, went back in, checked it, and saved that.
I am thinking maybe I should uninstall it, and download the latest version (in case my copy is damaged). I'll check, after I uninstall it, to make sure the setting no longer appears on the Permissions page.
I removed the MOD. The permissions setting no longer appeared. I downloaded the current version (the site says 1.5, packages page on my site says 1.0). Installed with no errors. The permission is again available to be set. It is set enabled for my global mods (it appears the value is kept even if the code is removed). It still is not visible to my Global Mods.
I am running 1.1.9 (via updates from earlier versions).
No errors are reported during install or uninstall.
Any additional assistance is most welcome.
Grazie,
Cal
Uninstalling the mod is only removing the script data however the setting is remaining in the database somewhere. I'm just not sure off hand where. :-[
True, and it would not be a problem, except the data must now be in a form that fails the test.
Considering there can be obsolete data from [SinaN]'s previous version of this MOD (and clearing I have that obsolete data and can't clear it by disabling and enabling the option in permissions), would it be possible to alter the MOD to utilise a new variable? I know it's not good form to leave orphan data (the old variable), but the MOD code can't just transfer the old data or else the bad data is simply moved.
An alternative would be to validate the data and confirm its a 1-bit True/False toggle. But then the code has to carry a lot of error trapping code (instead of, say finding a binary toggle, it's a number set to zero or one, or a text string set to "0" or "1" or any number of possible conditions).
Or maybe code that drops the variable after the MOD is uninstalled (either part of the process, or a separate php file run manually).
Grazie,
Cal
The problem is that no one is actively working on this mod at the moment. In the past the Can Post As Alternative User part was created by karlbenson, then continued by SiNaN, then continued by BurkeKnight. The Change Poster Of Topic And Message was created by SiNaN, then continued by BurkeKnight. Recently TheDeath, out of the kindness of his heart, updated both mods over to 2.x. I have no idea what his continued support will be. I'm not sure what happened to BK but he seems to have disappeared.
So in the meantime all support is user generated, if or when the mod gets updated remains to be seen. Right now I'm working on several other projects but soon as I can clear my plate if no one else claims this mod Ill go ahead and officially take it over as it holds a special place in my heart.
That said you'll have to manually remove the field from your database. Its in smf_board_permissions as reply_alternate. Once you've done that you can reinstall the mod again and hopefully it will work properly for you. Its working on a fresh install of SMF I set up but if you run into any problems let us know.
Hello Cal O'Shaw and Garou,
i can give next time the support for the SMF2 Version.
For the SMF1.1.9 can give also, but i must installed this. ::)
Garou,
Thanks for the info. I uninstalled the MOD, removed the field from the table, then installed the MOD. The permissions were set to the default of "No", but enabling in Permissions did not enable the MOD for the Global Moderators.
TheDeath,
You have already been very kind and most helpful. If you find the time to help with my problem, that is super, if not, please don't worry about it.
Regards,
Cal
Cal, I'm really at a loss on this one. :-[
Are you using a custom theme for the site or allow your users to pick a different theme? Have you tested this on the default theme? If your mods are using a different theme, check the themes Post.template.php to make sure the code is there compare it to http://custom.simplemachines.org/mods/index.php?action=parse;mod=1554;attach=79869;smf_version=1.1.7. Check your error logs and see if any errors pop up when an admin uses the feature.
If the code is messed up in the other files it should either break your forum or the mod shouldn't work for you either but you may want to double check that as well.
TheDeath, if you want to take over the mod I suggest that you go ahead and submit your version at http://custom.simplemachines.org/mods/index.php?action=postmod;sa=new. Once they approve it, post a link to the mod and its official thread here so people know to go there for support instead. I'm more then willing to help you support it and if you want I can help you out with keeping everything updated or even improving upon the mod. If you go back and check the threads for when this was SiNaN's mod(s) there are still features people were asking for that haven't made it in yet. ;D
Hello Garou,
I have the mod submitted on 03.07. in the modification section and I waiting for approve. ;)
This is the link to this http://custom.simplemachines.org/mods/index.php?mod=1941
Thanks for your help.
Sweet!!! I cant wait to see this mod back in capable hands. Anything you need let me know. :)
I'm using the default theme in 1.1.9. As an Admin it works fine. For anyone else, it seems to be having a problem with the logic to decide to show the option.
It's been really handy in reassigning ownership of orphaned topics and posting Official announcements rather than having a specific member assigned (and possibly taking some heat from unhappy readers).
For now, I do the name change, but it's be nice to have the Global Mods doing this (they're managers without access to operational details).
Grazie,
Cal
As for the posting as another user not working I cant figure out why its not working right for other users. If the code is correct and they are set to use it it should work fine.
As far as re-attributing posts to another user, that is an admin only function. When SiNaN created the original mod it was done that way on purpose as a security measure., at least I thought he mentioned it in his thread for the mod at one point. There might be a way to work around that though. I have an idea I just have to test it out. :)
Quote from: Garou on June 30, 2009, 08:21:42 PM
http://sleepycode.com/PackageParser/index.php go to this site and upload the package you have on your server and it will tell you what code you need to change. On a side note it usually best to uninstall mods before upgrading smf.
Thanks for this tip!
And Thanks to The Death for the upgrade. Just installed on my RC1-1 forum.
To get around the admin only function of re-attributing posts to another user...
With the mod installed, in ./Sources/Subs-Post.php find...
if(isset($_POST['changeposterid']) && $context['user']['is_admin'])
And change to...
if(isset($_POST['changeposterid']) && (allowedto('reply_alternate')))
and in ./Themes/default/Post.template.php find...
for="text_staffid">'.$txt['adminscanpostasaltuserid'].': <input type="text" name="staffid" id="staffid" size="5" /></label></td>
</tr>';
}
if ($context['user']['is_admin'] && isset($_REQUEST['msg']))
and change to...
for="text_staffid">'.$txt['adminscanpostasaltuserid'].': <input type="text" name="staffid" id="staffid" size="5" /></label></td>
</tr>';
}
if (allowedto('reply_alternate') && isset($_REQUEST['msg']))
This should allow anyone that has the "Can reply as an alternate user" permission to also be able to change the Poster ID.
If coded properly there should be a separate permission for this or at least the language strings in the mod should be changed to reflect that the user has both abilities when you set the permission for them. This is just a quick and dirty fix that will do what you need. :)
This wont upload on 1.1.9. Keep getting the error:
The package you tried to upload either is not a valid package or has become corrupted.
Is there anyone that still has the older version by karl that they can share because I used to have it and it worked well, however due to a reformat way back then, I lost it.
TIA
I just installed this mod on a fresh copy of 1.1.9 and 1.1.10, it installs perfectly.
Quote from: TheDeath on July 05, 2009, 10:46:51 AM
Hello Garou,
I have the mod submitted on 03.07. in the modification section and I waiting for approve. ;)
This is the link to this http://custom.simplemachines.org/mods/index.php?mod=1941
Thanks for your help.
I noticed that your version still hasn't been approved, whats holding it up and do you need help? Id love to see this mod back under someones care.
any way we can get this for 2.0 RC1.2?
TheDeath updated it at http://www.simplemachines.org/community/index.php?topic=280897.msg2129057#msg2129057 and was at least trying to get it released as his own mod since the current author seems to be MiA. SMF hasn't officially approved his mod for release but it works just fine.
Quote from: Garou on September 27, 2009, 10:33:45 AM
TheDeath updated it at http://www.simplemachines.org/community/index.php?topic=280897.msg2129057#msg2129057 and was at least trying to get it released as his own mod since the current author seems to be MiA. SMF hasn't officially approved his mod for release but it works just fine.
You (AND TheDeath) are my heros!!! :)
Quote from: TheDeath on June 25, 2009, 05:40:21 PM
Hello all,
in the attachment ist the modified MOD.
This work under SMF 2.0 RC1. SMF 2.0 RC1-1.
@BurkeKnight: You can use this do update your mod and upload it into mod database. ;)
Kind regards,
TheDeath
Thank you for this however on 2.0 RC1.2 I am getting this error in my logs after changing the topic starter:
action=post2;start=0;msg=27536;a2f80ff0e9=22566bab77f1d98bd8edecb090e340a2;board=60
8: Use of undefined constant id - assumed 'id'
File: /home/****/public_html/Sources/Subs-Post.php
Line: 2561
hmmm interesting. Did the mod install with out errors or did you have to edit any of it by hand?
Attach your .Sources/Subs-Post.php and well take a look at it.
Quote from: Garou on September 27, 2009, 10:19:35 PM
hmmm interesting. Did the mod install with out errors or did you have to edit any of it by hand?
Attach your .Sources/Subs-Post.php and well take a look at it.
I did have to edit one file but it wasnt that one, it was sources/post.php and that was because it couldnt find the info due to it looking for the line:
"// Have admins allowed people to hide their screwups?"
which is not actually the true line in that area
file attached
I tested out the post/edit as alternate user and didnt get any errors on that one.
Also.. where are the permissions located for this mod, I cant seem to find them.
hmm I just set up a 2.0RC1.2 test site and and it installed and works fine. I do get the error in the logs on the function though. Ill have to look at it more to figure out why.
The only permission is "Can reply as an alternate user" which is under the permissions for "Moderate the board". The Attribute post to another user function is an admin only but I posted a couple pages back (http://www.simplemachines.org/community/index.php?topic=280897.msg2147735#msg2147735) in this thread on how to tie it to the "Can reply as an alternate user" so the one permission gives you access to both.
I think I found the fix...
In /Sources/Subs-Post.php look for...
//Found it! Change the starter id.
if ($smcFunc['db_num_rows']($dbresult) == 1)
{
$smcFunc['db_query']('', "
UPDATE {db_prefix}topics
SET id_member_started = {int:change}
WHERE id_first_msg = {string:id}
LIMIT 1",
array(
'change' => $changeposteridno,
'id' => $msgOptions[id],
)
);
Replace....
'id' => $msgOptions[id],
With...
'id' => $msgOptions['id'],
At least it didn't error out for me when I changed it. :)
Quote from: Garou on September 28, 2009, 11:32:19 AM
hmm I just set up a 2.0RC1.2 test site and and it installed and works fine. I do get the error in the logs on the function though. Ill have to look at it more to figure out why.
The only permission is "Can reply as an alternate user" which is under the permissions for "Moderate the board". The Attribute post to another user function is an admin only but I posted a couple pages back (http://www.simplemachines.org/community/index.php?topic=280897.msg2147735#msg2147735) in this thread on how to tie it to the "Can reply as an alternate user" so the one permission gives you access to both.
I think I found the fix...
In /Sources/Subs-Post.php look for...
//Found it! Change the starter id.
if ($smcFunc['db_num_rows']($dbresult) == 1)
{
$smcFunc['db_query']('', "
UPDATE {db_prefix}topics
SET id_member_started = {int:change}
WHERE id_first_msg = {string:id}
LIMIT 1",
array(
'change' => $changeposteridno,
'id' => $msgOptions[id],
)
);
Replace....
'id' => $msgOptions[id],
With...
'id' => $msgOptions['id'],
At least it didn't error out for me when I changed it. :)
Just made the change and it appears that fixed it (no errors on my end anymore either). Thank you for fixing it. :)
As for the permissions.. those are ok the way they are.. I just wanted to make sure that I could control who had access to either feature is all. I was really tired last night and guess I just overlooked the one listed :).
Thanks again. :)
i have the problem to change </tr>' : '', '
</table>
</div>
</td>
</tr>';
for
</tr>' : '';
if (allowedto('reply_alternate'))
{
echo ' <tr>
<td class="smalltext"><label for="check_postasforumstaff"><input type="checkbox" name="postasforumstaff" id="postasforumstaff" value="1" class="check" /> '.$txt['adminscanpostasaltuser'].'</label></td>
<td class="smalltext"><label for="text_staffid">'.$txt['adminscanpostasaltuserid'].': <input type="text" name="staffid" id="staffid" size="5" /></label></td>
</tr>';
}
if ($context['user']['is_admin'] && isset($_REQUEST['msg']))
{
echo ' <tr>
<td class="smalltext"><label for="check_changeposterid"><input type="checkbox" name="changeposterid" id="changeposterid" value="1" class="check" /> '.$txt['changeposterid'].'</label></td>
<td class="smalltext"><label for="text_changeposteridno">'.$txt['changeposteridno'].': <input type="text" name="changeposteridno" id="changeposteridno" size="5" /></label></td>
</tr>';
}
echo ' </table>
</div>
</td>
</tr>';
because the place to change is take by another mod:
</tr>' : '';
if ($context['can_modify_any'] && isset($_REQUEST['msg']) && $context['is_first_post'])
{
echo ' <tr>
<td class="smalltext"><label for="check_changeallsubject"><input type="checkbox" name="changeallsubject" id="changeallsubject" value="1" class="check" /> ' . $txt['changeallsubject'] . '</label></td>
<td class="smalltext"></td>
</tr>';
}
echo ' </table>
</div>
</td>
</tr>';
anybody can help?
hmmm It looks like you are trying to have this mod as well as Change All Subjects (http://custom.simplemachines.org/mods/index.php?mod=1165), correct?
Try...
</tr>' : '';
if (allowedto('reply_alternate'))
{
echo ' <tr>
<td class="smalltext"><label for="check_postasforumstaff"><input type="checkbox" name="postasforumstaff" id="postasforumstaff" value="1" class="check" /> '.$txt['adminscanpostasaltuser'].'</label></td>
<td class="smalltext"><label for="text_staffid">'.$txt['adminscanpostasaltuserid'].': <input type="text" name="staffid" id="staffid" size="5" /></label></td>
</tr>';
}
if ($context['user']['is_admin'] && isset($_REQUEST['msg']))
{
echo ' <tr>
<td class="smalltext"><label for="check_changeposterid"><input type="checkbox" name="changeposterid" id="changeposterid" value="1" class="check" /> '.$txt['changeposterid'].'</label></td>
<td class="smalltext"><label for="text_changeposteridno">'.$txt['changeposteridno'].': <input type="text" name="changeposteridno" id="changeposteridno" size="5" /></label></td>
</tr>';
}
if ($context['can_modify_any'] && isset($_REQUEST['msg']) && $context['is_first_post'])
{
echo ' <tr>
<td class="smalltext"><label for="check_changeallsubject"><input type="checkbox" name="changeallsubject" id="changeallsubject" value="1" class="check" /> ' . $txt['changeallsubject'] . '</label></td>
<td class="smalltext"></td>
</tr>';
}
echo ' </table>
</div>
</td>
</tr>';
If that doesn't work let me know and Ill try to come up with something else or you might want to try the support thread for the other mod. [SiNaN] was a developer of this mod at one point as well as the other, so he may have run into this issue in the past.
Quote from: TheDeath on June 29, 2009, 04:10:33 PM
No problem 8).
You're right, it's a really good mod
It sure is! Thanks!!!
Hi, i'm using smf 1.1.10 and have installed this mod. I'm using custom themes and this mod doesn't appear in reply page as mention. But when I change to default theme, the check box & text box appear.
Can somebody help me on this. By looking at manual installation, it change the Post.template.php on default theme. But, in my custom theme, the file don't exists.
Tq in advance.
You might try copying the Post.template.php from the default theme to your custom theme and see if that helps.
What theme are you using?
Will this be updated for RC2?
Since BK the author that is supposed to be working on the mod has disappeared I cant say for sure. At one point TheDeath updated it for 2.0 at http://www.simplemachines.org/community/index.php?topic=280897.msg2129057#msg2129057 and submitted it as his own mod but for some reason it hasn't been approved. Probably due to the small error I fixed back in this post... http://www.simplemachines.org/community/index.php?topic=280897.msg2280630#msg2280630.
A while back this was two different mods for 1.1.x only by yet another author. He had offered them up for someone to take over and I was talking to him and trying to update them for 2.x when BK sent him a package of the 2 mods combined and it became this mod.
I tend to use these/this mod myself a lot so if it isn't updated by someone else (BK or TheDeath) soon, Ill probably end up doing it myself and submitting it under my name.
That would be great, because I use this mod a TON and really need it for RC2
^^^DITTO!
I have updated the mod to work with RC2. If you want you can use it until official updated version of mod comes.
http://www.oyun-arsivi.net/mods/Post.and.Change.as.Alternate.User_RC2.zip
or
http://rapidshare.com/files/310252471/Post.and.Change.as.Alternate.User_RC2.zip
great to hear Turk Navy. I cant wait to see what you did. I was working on it this morn before I left the house for work and was running into issues on the post template.
Since its done Ill stop working on it and let you release it as your own since I dont think BK is coming back.
Just be sure to credit Karl Benson, [SiNaN], BK and The Death as previous authors.
I agree with you, I didn't edit author's name or readme file which contains the other author's names to credit them. If this version of mod works perfectly with your forums too, I can release as my own and of course, write their names.
I finally got the chance to test it out and it works perfectly.
After comparing your version to the one I was working on I was missing the echo statement before the list code based on the rest of the code in that section I didn't think it was needed.
This is the Read Me file I had worked out for my version when I finished it, since you beat me to it, feel free to use and alter it to fit you.
[center][b][color=red][size=14pt]Post as and Attribute Single Post to Alternate User v2.1[/size][/color][/b][/center]
[center]By [b][url=http://custom.simplemachines.org/mods/index.php?action=profile;u=60251]Garou[/url][/b][/center]
[hr]
[center][url=http://www.simplemachines.org/community/index.php?topic=280897.0]Support topic[/url] | [url=http://custom.simplemachines.org/mods/index.php?mod=1554]Link to Mod[/url]
[color=red]Note: Refers to the last incarnation of the mod and will be updated once new support boards and downloads are set up.[/color][/center]
[hr]
[b][color=blue][size=10pt]Introduction:[/size][/color][/b]
This mod consists of two parts.
Post as alternate user, allows members with the assigned permission to post and edit posts as if they are another forum user.
Attribute posts to another user, allows admins to assign ownership of a particular post to another user.
[b][color=blue][size=10pt]Features:[/size][/color][/b]
To post or edit a post as an alternate user click on "Additional Options..." below the post box area, there will be a check box for "Post/Edit As Alternative User" and a box to enter "Alternative User ID:". Make sure the check box is checked and then enter either the user ID of an existing user to post as that user or enter "0" to post as guest Forum Staff.
To edit an existing post and change the author to another existing forum member click on Additional Options... below the post box area, there will be a check box for "Change Poster/Starter" and a box to enter "Poster ID:". Make sure the check box is checked and then enter the user ID of an existing user and the author of the post will be changed to that of a user you chose. [color=red]Note: The UserID you enter must be that of a valid/existing user. You can not attribute the post to a guest or no user.[/color]
To find the ID number of a user go to their profile and look at the URL or link eg.../index.php?action=profile;u=1 "u=some number" the number is the user id of the member.
To set the permission to post and reply as an alternate user edit the permissions for a particular group and under the settings for "Posts", check the box for "Can reply as an alternate user".
The ability to change the author of an existing post is currently an admin only permission and can not be set for another group.
[b][color=blue][size=10pt]Installation:[/size][/color][/b]
To install, simply upload the entire zip file to the package manager (Admin -> Package Manager -> Download New Packages).
To install on a custom theme, please refer to the package parser and manually apply the changes for ./Themes/default/... to ./Themes/your custom theme/...
[b][color=blue][size=10pt]Compatibility:[/size][/color][/b]
Tested under SMF Versions 1.1.10 and 2.0 RC1 - 2.0 RC2
[b][color=blue][size=10pt]Credits:[/size][/color][/b]
Special thanks to all the people who have worked on this mod (in some version) in the past...
[url=http://custom.simplemachines.org/mods/index.php?action=profile;u=63186]karlbenson[/url], [url=http://custom.simplemachines.org/mods/index.php?action=profile;u=118168][SiNaN][/url], [url=http://custom.simplemachines.org/mods/index.php?action=profile;u=194815]BK-S-M-F Modding Team[/url] aka. [url=http://custom.simplemachines.org/mods/index.php?action=profile;u=150637]BurkeKnight[/url], and [url=http://custom.simplemachines.org/mods/index.php?action=profile;u=207533]TheDeath[/url].
[b][color=blue][size=10pt]Change log:[/size][/color][/b]
[b]Version:2.1[/b] Date: October 22, 2009
* Support for mod taken over by Garou
! Some minor bug fixes
* Updated to support SMF version 2.0 RC2
[b]Version:2.0[/b] Date: June 25, 2009
* Mod updated to support 2.x versions of SMF by TheDeath
[b]Version: 1.5[/b] Date: December 10, 2008
* Change Poster Of Message And Topic & Post As An Alternative User mods taken over by BK-SMF.
+ Both Mods combined for use with SMF 1.1 to prevent conflicts between the two.
[i]All previous incarnations of this mod were created and supported by karlbenson and/or [SiNaN] [/i]
[b]Legend:[/b]
! bug fix
+ added feature
* changed
> Comment
You might also want to add 1.1.x support to the mod or at least direct people to this version for 1.1.x support. This version works fine but if the are any further changes in the 1.1.x line this version may stop working. Either way I'm sure the users appreciate the additional support.
There is some tweaking that could be done to the mod. Back when [SiNaN] was working on these mods separately people were asking that the user ID be changed to user name. There were a couple other things but I don't remember them off hand.
In the end great job and I look forward to what you might come up with in the future.
Thank you for your comment. However, it seems you worked on this mod more than I did. You prepared your files etc, I didn't know that. So, If you want you can take over this mod. :)
In the end you found the solution before I did so as far as I'm concerned its yours, I have several other project to keep me busy. Ive just been using these two features a long time and am quite familiar with them. If you aren't interested in supporting the mod for the long term Id be happy to take it on.
These are very useful features not only for me but many members of the SMF community so as long as someone is willing to keep the mod up to date I'm happy. Its completely up to you. :)
We're on 1.1.10 and our Global Moderators can't post as alternate users, even though I've given them permission.
We have the 1.5 version by BK. Is there a later version that might fix this?
Grazie!
Unless some of the code has been changed it should work. Are you getting any errors? Are they seeing the field in post options at all?
The permissions are set to on, but when they create a new post, they do not see the options to post as another user. I've uninstalled and reinstalled a few times with no errors.
I should note that we had originally installed both of [SiNaN]'s MODs (with a bit of editing) and it took some work to extract them when he pulled them (when a MOD gets pulled, it's no longer possible to use the manual parse, which makes extracted a dead MOD really, REALLY difficult. I wish there was a way to stop people from downloaded dead MODs but keep the manual parse feature working).
Well there are a few of us around that run alternate package parsers on our sites where you upload the packaged mod and then it works pretty much like the SMF parser.
The two I know off the top of my head are http://sleepycode.com/PackageParser and http://smf.balancegames.net/PackageParser
Ah, grazie! I'll have to send MODBREAK up as we modified things to utilise permissions with it.
But I am concerned that even though the MOD installed without error, and I gave the permissions to my Global Moderators, they don't see the options when using the Edit Post panel. But as an Admin, I do.
Cal
They should be seeing the post as but not the change posts author. Unless you change the mod as I suggested several pages back in this thread attributing a post to another user is an admin only function.
Then why do I have in Permissions, under Permissions -> Global Moderator -> Global Permissions - > Posts:
"Can reply as an alternate user" and choices of A, D, X
They don't see any additional options than groups with the permission denied.
When you go to modify a message the following error comes up in the error log. My guess is that it's because of the missing text next to the second "tickable" option on the post page where you can change the owner of a topic.
Administrator Today at 12:36:26 PM
<ip removed> c34817ae3874dc85aa86a462789e5b0a
http://www.mysite.com/index.php?action=post;msg=2;topic=2.0;sesc
8: Undefined index: changeposterid
File: /home/mysite/Themes/default/languages/Post.english.php (main sub template - eval?)
Line: 564
Edit: I just checked the referenced file and it doesnt even go up to 200 lines and the error is referencing line 564.
Quote from: Cal O'Shaw on November 24, 2009, 02:13:38 PM
Then why do I have in Permissions, under Permissions -> Global Moderator -> Global Permissions - > Posts:
"Can reply as an alternate user" and choices of A, D, X
They don't see any additional options than groups with the permission denied.
Hello, just wondering if what I'm seeing is supposed to be there, and if so, why it is not working.
Grazie
VERY COOL!
Just installed on my RC2 forum w/o problems!
Thanks TurkNavy!!! Bravo!
Is it possible when we post instead of ID, this ID seems login in online list? Thanks
Since we cant get to the current author of this mod, I can't create an official topic and mod page for it. However, I'll try to provide suupport from this topic as I could.
Post as and Attribute Single Post to Alternate User v2.1Post.as.and.Attribute.Single.Post.to.Alternate.User_RC2.zip (http://www.oyun-arsivi.net/mods/Post.as.and.Attribute.Single.Post.to.Alternate.User_RC2.zip)
Post.as.and.Attribute.Single.Post.to.Alternate.User_1.1.11.zip (http://www.oyun-arsivi.net/mods/Post.as.and.Attribute.Single.Post.to.Alternate.User_1.1.11.zip)
Quote from: akbora on January 05, 2010, 04:46:20 PM
Is it possible when we post instead of ID, this ID seems login in online list? Thanks
I think it is possible, I'll try this on my free time. :)
Quote from: Turk Navy on January 12, 2010, 02:05:05 PM
Since we cant get to the current author of this mod, I can't create an official topic and mod page for it. However, I'll try to provide suupport from this topic as I could.
Post as and Attribute Single Post to Alternate User v2.1
Post.as.and.Attribute.Single.Post.to.Alternate.User_RC2.zip (http://www.oyun-arsivi.net/mods/Post.as.and.Attribute.Single.Post.to.Alternate.User_RC2.zip)
Post.as.and.Attribute.Single.Post.to.Alternate.User_1.1.11.zip (http://www.oyun-arsivi.net/mods/Post.as.and.Attribute.Single.Post.to.Alternate.User_1.1.11.zip)
Quote from: akbora on January 05, 2010, 04:46:20 PM
Is it possible when we post instead of ID, this ID seems login in online list? Thanks
I think it is possible, I'll try this on my free time. :)
What's new in the package?
I just edited readme files and ordered the codes, there is nothing new actually.
I want just to notify a conflict with this mod:
http://www.simplemachines.org/community/index.php?topic=234633.msg2451722#msg2451722
I've been using this mod for quite some time, I love the ability to designate 0 and have the post come from "Forum Staff"
I wish this worked for PMs
Nice, works on RC3. Should have been default. maybe in 2.1
How did you manage to install on RC3?
Quote from: abhibehr on March 12, 2010, 04:01:09 PM
How did you manage to install on RC3?
I use this unofficial
http://www.simplemachines.org/community/index.php?topic=280897.msg2451230#msg2451230
It should work on RC3 as well.
Is anyone planning to take this over and improve it to the point where it can accept user names as well as just ids? Lack of that functionality is one of the few things keeping me on PHP.
Nice Mod
Please update it for SMF 2.0RC3 ;)
Thanks
Geez, Eclipse16V do you EVER bother to read the thread???
Quote from: Dismal Shadow on March 12, 2010, 04:48:18 PM
Quote from: abhibehr on March 12, 2010, 04:01:09 PM
How did you manage to install on RC3?
I use this unofficial
http://www.simplemachines.org/community/index.php?topic=280897.msg2451230#msg2451230
It should work on RC3 as well.
Why not official?
Did you read the thread? You'd have seen that the author hasn't had been around here for a very long time.
Hi, have a problem with this mod.
My SMF version is 1.1.11
In some boards (not all), when i delete a topic, i can't see any topic.
But if i create a new topic, i see every topic of that board.
I also say that when i don't see any topic, they remain in database but I don't see them
thanks a lot to apply to RC3!
I had a lot of time trying to find an alternative and found no ;D
Quote from: Turk Navy on January 12, 2010, 02:05:05 PM
Since we cant get to the current author of this mod, I can't create an official topic and mod page for it. However, I'll try to provide suupport from this topic as I could.
Post as and Attribute Single Post to Alternate User v2.1
Post.as.and.Attribute.Single.Post.to.Alternate.User_RC2.zip (http://www.oyun-arsivi.net/mods/Post.as.and.Attribute.Single.Post.to.Alternate.User_RC2.zip)
Post.as.and.Attribute.Single.Post.to.Alternate.User_1.1.11.zip (http://www.oyun-arsivi.net/mods/Post.as.and.Attribute.Single.Post.to.Alternate.User_1.1.11.zip)
Quote from: akbora on January 05, 2010, 04:46:20 PM
Is it possible when we post instead of ID, this ID seems login in online list? Thanks
I think it is possible, I'll try this on my free time. :)
Thank you for RC2 update! I have one question. in file post.php i was not change anything because other modification in there and mod work fine. Erorr log is clean.
Can you tell me for what are changes in that file?
Getting one error in this..
Highlighted the line which is pulling the error
Quote';
if (allowedto('reply_alternate')) {
echo '<li><label for="check_postasforumstaff"><input type="checkbox" name="postasforumstaff" id="postasforumstaff" value="1" class="check" /> '.$txt['adminscanpostasaltuser'].'</label>
<label for="text_staffid">'.$txt['adminscanpostasaltuserid'].': <input type="text" name="staffid" id="staffid" size="5" /></label></li>';
}
if ($context['user']['is_admin'] && isset($_REQUEST['msg'])) {
echo '<li><label for="check_changeposterid"><input type="checkbox" name="changeposterid" id="changeposterid" value="1" class="check" /> '.$txt['changeposterid'].'</label>
<label for="text_changeposteridno">'.$txt['changeposteridno'].': <input type="text" name="changeposteridno" id="changeposteridno" size="5" /></label></li>';
}
echo '
</ul>
</div>';
Attached images.
Using RC3 and the "unofficial" update
Quote from: C4G-TK on July 06, 2010, 12:49:18 AM
Getting one error in this..
Highlighted the line which is pulling the error
Quote';
if (allowedto('reply_alternate')) {
echo '<li><label for="check_postasforumstaff"><input type="checkbox" name="postasforumstaff" id="postasforumstaff" value="1" class="check" /> '.$txt['adminscanpostasaltuser'].'</label>
<label for="text_staffid">'.$txt['adminscanpostasaltuserid'].': <input type="text" name="staffid" id="staffid" size="5" /></label></li>';
}
if ($context['user']['is_admin'] && isset($_REQUEST['msg'])) {
echo '<li><label for="check_changeposterid"><input type="checkbox" name="changeposterid" id="changeposterid" value="1" class="check" /> '.$txt['changeposterid'].'</label>
<label for="text_changeposteridno">'.$txt['changeposteridno'].': <input type="text" name="changeposteridno" id="changeposteridno" size="5" /></label></li>';
}
echo '
</ul>
</div>';
Attached images.
Using RC3 and the "unofficial" update
I have four pages of this error in my log even though I haven't actually used it to change anyone's ID. Anyone know a fix?
Thanks, great mod and works fine with RC3 :D :D
But I figured out that the post of the member I posted for is the same than before.
E.g. Poster A has 10 postings I change a thread to poster A than the posting is not 11 it is 10 anymore.
A solution for this?
Thanks
Just so you know. I have made a similar mod to this for 2.0. When choosing the user it works like when choosing a user to send a PM to. I don't think there is anything this mod does that mine can't do and mine is supported unlike this one. So.... http://custom.simplemachines.org/mods/index.php?mod=2626
nice mod
any chance for 2.0 Gold support ?
Can i have the link for Post.as.and.Attribute.Single.Post.to.Alternate.User_RC2.zip ? (then one in this topic doesn't exist anymore)
Where can i download Post as and Attribute Single Post to Alternate User v2.1 ? The links in the thread are inactive.
Does anyone have a copy of the 2.1 version left?
The links don't work any more.
Cheers
I had to dig through an zipped up archive of a now dead site but I found it.
Since they frown on attaching modified packages here, Ill post the files.
install.xml
<?xml version="1.0"?>
<!DOCTYPE modification SYSTEM "http://www.simplemachines.org/xml/modification">
<modification xmlns="http://www.simplemachines.org/xml/modification" xmlns:smf="http://www.simplemachines.org/">
<id>Turk Navy:Post as and Attribute Single Post to Alternate User</id>
<version>2.1</version>
<file name="$languagedir/ManagePermissions.english.php">
<operation>
<search position="end" />
<add><![CDATA[
$txt['permissionname_reply_alternate'] = 'Can reply as an alternate user';
$txt['permissionhelp_reply_alternate'] = 'Allow user to post as an alternate user.';]]></add>
</operation>
</file>
<file name="$languagedir/Modifications.english.php">
<operation>
<search position="end" />
<add><![CDATA[$txt['changeposterid'] = 'Change Poster/Starter';
$txt['changeposteridno'] = 'Poster ID';
$txt['adminscanpostasaltuser'] = 'Post/Edit As Alternative User';
$txt['adminspostasguestcalled'] = 'Forum Staff';
$txt['adminscanpostasaltuserid'] = 'Alternative User ID';
]]></add>
</operation>
</file>
<file name="$languagedir/ManagePermissions.english-utf8.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
$txt['permissionname_reply_alternate'] = 'Can reply as an alternate user';
$txt['permissionhelp_reply_alternate'] = 'Allow user to post as an alternate user.';]]></add>
</operation>
</file>
<file name="$languagedir/Modifications.english-uft8.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[$txt['changeposterid'] = 'Change Poster/Starter';
$txt['changeposteridno'] = 'Poster ID';
$txt['adminscanpostasaltuser'] = 'Post/Edit As Alternative User';
$txt['adminspostasguestcalled'] = 'Forum Staff';
$txt['adminscanpostasaltuserid'] = 'Alternative User ID';
]]></add>
</operation>
</file>
<file name="$sourcedir/ManagePermissions.php">
<operation>
<search position="replace"><![CDATA[ 'delete' => array(true, 'post', 'modify', 'moderate'),
'modify' => array(true, 'post', 'modify', 'moderate'),]]></search>
<add><![CDATA[ 'delete' => array(true, 'post', 'modify', 'moderate'),
'modify' => array(true, 'post', 'modify', 'moderate'),
'reply_alternate' => array(false, 'post', 'modify', 'moderate'),]]></add>
</operation>
</file>
<file name="$sourcedir/Post.php">
<operation>
<search position="replace"><![CDATA[ // Have admins allowed people to hide their screwups?
if (time() - $row['poster_time'] > $modSettings['edit_wait_time'] || $user_info['id'] != $row['id_member'])
{
$msgOptions['modify_time'] = time();
$msgOptions['modify_name'] = $user_info['name'];]]></search>
<add><![CDATA[ // Have admins allowed people to hide their screwups?
if (time() - $row['poster_time'] > $modSettings['edit_wait_time'] || $user_info['id'] != $row['id_member'])
{
$msgOptions['modify_time'] = time();
if (isset($_POST['postasforumstaff']) && (allowedto('reply_alternate')))
{
// ENSURE ALT USER ID IS AN INTEGER
$staffid = !empty($_POST['staffid']) ? (int) $_POST['staffid'] : 0 ;
// USER ID = 0, POST AS GUEST
if ($staffid == 0)
{
$msgOptions['modify_name'] = addslashes($txt['adminspostasguestcalled']);
} elseif($staffid > 0) {
// QUERY DB TO GET NAME OF USER
$dbresult = $smcFunc['db_query']('', "
SELECT member_name
FROM {db_prefix}members
WHERE id_member = {int:staffid}
LIMIT 1",
array(
'staffid' => $staffid,
)
);
// FOUND USER WANTING TO POST AS
if ($smcFunc['db_num_rows']($dbresult) != 0)
{
list ($msgOptions['modify_name']) = $smcFunc['db_fetch_row']($dbresult);
$smcFunc['db_free_result']($dbresult);
} else {
// NOPE, DOESNT EXIST (ANYMORE?) SO BE A GUEST
$msgOptions['modify_name'] = addslashes($txt['adminspostasguestcalled']);
}
} else {
// shouldnt have reached here, so proceed as normal post
$msgOptions['modify_name'] = addslashes($user_info['name']);
}
} else {
// proceed as normal
$msgOptions['modify_name'] = $user_info['name'];
}]]></add>
</operation>
</file>
<file name="$sourcedir/Subs-Post.php">
<operation>
<search position="after"><![CDATA[ // If nothing was filled in as name/e-mail address, try the member table.
if (!isset($posterOptions['name']) || $posterOptions['name'] == '' || (empty($posterOptions['email']) && !empty($posterOptions['id'])))]]></search>
<add><![CDATA[ if(isset($_POST['postasforumstaff']) && (allowedto('reply_alternate')))
{
// check variable exists or make it to avoid error
$staffid = !empty($_POST['staffid']) ? (int) $_POST['staffid'] : 0 ;
// default selected, post as guest
if ($staffid == 0)
{
$posterOptions['name'] = $txt['adminspostasguestcalled'];
$posterOptions['id'] = 0;
$posterOptions['ip'] = '0.0.0.0';
$posterOptions['email'] = '';
} elseif($staffid > 0) {
// QUERY DB TO GET NAME OF USER
$dbresult = $smcFunc['db_query']('', "
SELECT id_member
FROM {db_prefix}members
WHERE id_member = {int:staffid}
LIMIT 1",
array(
'staffid' => $staffid,
)
);
// FOUND USER WANTING TO POST AS
if ($smcFunc['db_num_rows']($dbresult) != 0)
{
$posterOptions['id'] = $staffid;
$posterOptions['ip'] = '0.0.0.0';
$posterOptions['email'] = '';
unset($posterOptions['name']);
$smcFunc['db_free_result']($dbresult);
} else {
// NOPE, DOESNT EXIST (ANYMORE?) SO BE A GUEST
$posterOptions['name'] = $txt['adminspostasguestcalled'];
$posterOptions['id'] = 0;
$posterOptions['ip'] = '0.0.0.0';
$posterOptions['email'] = '';
}
}else{
// oops, something should not get this far?
// proceed as normal
}
}]]></add>
</operation>
<operation>
<search position="before"><![CDATA[ // Change the post.
$smcFunc['db_query']('', '
UPDATE {db_prefix}messages
SET ' . implode(', ', $messages_columns) . '
WHERE id_msg = {int:id_msg}',
$update_parameters
);]]></search>
<add><![CDATA[ if(isset($_POST['changeposterid']) && $context['user']['is_admin'])
{
//Make sure it is an integer.
$changeposteridno = !empty($_POST['changeposteridno']) ? (int) $_POST['changeposteridno'] : 0 ;
//Should be greater than zero, no negative ids.
if($changeposteridno > 0)
{
//Check if the id exists.
$dbresult = $smcFunc['db_query']('', "
SELECT id_member, member_name, email_address, member_ip
FROM {db_prefix}members
WHERE id_member = {int:change}
LIMIT 1",
array(
'change' => $changeposteridno,
)
);
if ($smcFunc['db_num_rows']($dbresult) != 0)
{
//Change poster information.
while ($row = $smcFunc['db_fetch_assoc']($dbresult))
{
$smcFunc['db_query']('', "
UPDATE {db_prefix}messages
SET id_member = {int:change}, poster_name = {string:mName}, poster_email = {string:email}, poster_ip = {string:ip}
WHERE id_msg = {string:id}
LIMIT 1",
array(
'change' => $changeposteridno,
'mName' => $row['member_name'],
'email' => $row['email_address'],
'ip' => $row['member_ip'],
'id' => $msgOptions['id'],
)
);
}
$smcFunc['db_free_result']($dbresult);
//If it is topic, we should modify topic too.
$dbresult = $smcFunc['db_query']('', "
SELECT id_topic
FROM {db_prefix}topics
WHERE id_first_msg = {string:id}
LIMIT 1",
array(
'id' => $msgOptions['id'],
)
);
//Found it! Change the starter id.
if ($smcFunc['db_num_rows']($dbresult) == 1)
{
$smcFunc['db_query']('', "
UPDATE {db_prefix}topics
SET id_member_started = {int:change}
WHERE id_first_msg = {string:id}
LIMIT 1",
array(
'change' => $changeposteridno,
'id' => $msgOptions['id'],
)
);
}
$smcFunc['db_free_result']($dbresult);
}
}
}]]></add>
</operation>
</file>
<file name="$themedir/Post.template.php">
<operation>
<search position="replace"><![CDATA[ </ul>
</div>';]]></search>
<add><![CDATA[';
if (allowedto('reply_alternate')) {
echo '<li><label for="check_postasforumstaff"><input type="checkbox" name="postasforumstaff" id="postasforumstaff" value="1" class="check" /> '.$txt['adminscanpostasaltuser'].'</label>
<label for="text_staffid">'.$txt['adminscanpostasaltuserid'].': <input type="text" name="staffid" id="staffid" size="5" /></label></li>';
}
if ($context['user']['is_admin'] && isset($_REQUEST['msg'])) {
echo '<li><label for="check_changeposterid"><input type="checkbox" name="changeposterid" id="changeposterid" value="1" class="check" /> '.$txt['changeposterid'].'</label>
<label for="text_changeposteridno">'.$txt['changeposteridno'].': <input type="text" name="changeposteridno" id="changeposteridno" size="5" /></label></li>';
}
echo '
</ul>
</div>';]]></add>
</operation>
</file>
</modification>
package-info.xml
<?xml version="1.0"?>
<!DOCTYPE package-info SYSTEM "http://www.simplemachines.org/xml/package-info">
<package-info xmlns="http://www.simplemachines.org/xml/package-info" xmlns:smf="http://www.simplemachines.org/">
<id>Turk_Navy:Post_as_and_Attribute_Single_Post_to_Alternate_User</id>
<name>Post_as_and_Attribute_Single_Post_to_Alternate_User</name>
<version>2.1</version>
<type>modification</type>
<install>
<readme parsebbc="true">readme.txt</readme>
<modification>install.xml</modification>
</install>
<uninstall>
<modification reverse="true">install.xml</modification>
</uninstall>
</package-info>
readme.txt
[center][b][color=red][size=14pt]Post as and Attribute Single Post to Alternate User v2.1[/size][/color][/b][/center]
[center]By [b][url=http://custom.simplemachines.org/mods/index.php?action=profile;u=40245]Turk Navy[/url][/b][/center]
[hr]
[center][url=http://www.simplemachines.org/community/index.php?topic=280897.0]Support topic[/url] | [url=http://custom.simplemachines.org/mods/index.php?mod=1554]Link to Mod[/url]
[color=red]Note: Refers to the last incarnation of the mod and will be updated once new support boards and downloads are set up.[/color][/center]
[hr]
[b][color=blue][size=10pt]Introduction:[/size][/color][/b]
This mod consists of two parts.
Post as alternate user, allows members with the assigned permission to post and edit posts as if they are another forum user.
Attribute posts to another user, allows admins to assign ownership of a particular post to another user.
[b][color=blue][size=10pt]Features:[/size][/color][/b]
To post or edit a post as an alternate user click on "Additional Options..." below the post box area, there will be a check box for "Post/Edit As Alternative User" and a box to enter "Alternative User ID:". Make sure the check box is checked and then enter either the user ID of an existing user to post as that user or enter "0" to post as guest Forum Staff.
To edit an existing post and change the author to another existing forum member click on Additional Options... below the post box area, there will be a check box for "Change Poster/Starter" and a box to enter "Poster ID:". Make sure the check box is checked and then enter the user ID of an existing user and the author of the post will be changed to that of a user you chose. [color=red]Note: The UserID you enter must be that of a valid/existing user. You can not attribute the post to a guest or no user.[/color]
To find the ID number of a user go to their profile and look at the URL or link eg.../index.php?action=profile;u=1 "u=some number" the number is the user id of the member.
To set the permission to post and reply as an alternate user edit the permissions for a particular group and under the settings for "Posts", check the box for "Can reply as an alternate user".
The ability to change the author of an existing post is currently an admin only permission and can not be set for another group.
[b][color=blue][size=10pt]Installation:[/size][/color][/b]
To install, simply upload the entire zip file to the package manager (Admin -> Package Manager -> Download New Packages).
To install on a custom theme, please refer to the package parser and manually apply the changes for ./Themes/default/... to ./Themes/your custom theme/...
[b][color=blue][size=10pt]Compatibility:[/size][/color][/b]
Tested under SMF Versions 1.1.11 and 2.0 RC2
[b][color=blue][size=10pt]Credits:[/size][/color][/b]
Special thanks to all the people who have worked on this mod (in some version) in the past...
[url=http://custom.simplemachines.org/mods/index.php?action=profile;u=63186]karlbenson[/url], [url=http://custom.simplemachines.org/mods/index.php?action=profile;u=118168][SiNaN][/url], [url=http://custom.simplemachines.org/mods/index.php?action=profile;u=194815]BK-S-M-F Modding Team[/url] aka. [url=http://custom.simplemachines.org/mods/index.php?action=profile;u=150637]BurkeKnight[/url], and [url=http://custom.simplemachines.org/mods/index.php?action=profile;u=207533]TheDeath[/url].
And also special thanks to [url=http://www.simplemachines.org/community/index.php?action=profile;u=60251]Garou[/url] who prepared this excellent readme file and supported this mod.
[b][color=blue][size=10pt]Change log:[/size][/color][/b]
[b]Version:2.1[/b] Date: October 22, 2009
* Mod taken over by Turk Navy
! Some minor bug fixes
* Updated to support SMF version 2.0 RC2
[b]Version:2.0[/b] Date: June 25, 2009
* Mod updated to support 2.x versions of SMF by TheDeath
[b]Version: 1.5[/b] Date: December 10, 2008
* Change Poster Of Message And Topic & Post As An Alternative User mods taken over by BK-SMF.
+ Both Mods combined for use with SMF 1.1 to prevent conflicts between the two.
[i]All previous incarnations of this mod were created and supported by karlbenson and/or [SiNaN] [/i]
[b]Legend:[/b]
! bug fix
+ added feature
* changed
> Comment
Note that was working on an RC5 site so it should work on 2.0 Gold
Excellent Mod, BK Modding Team, just wish rather than adding the #1, we could add the actual name.
A couple of enhancements if anyone's interested:
SMF 1.1.16
Add one to alternate member's poster count
sources/subs-post.php
Find
while ($row = mysql_fetch_assoc($request))
{
db_query("
UPDATE {$db_prefix}messages
SET ID_MEMBER = ".$changeposteridno.", posterName = '".$row['memberName']."', posterEmail = '".$row['emailAddress']."', posterIP = '".$row['memberIP']."'
WHERE ID_MSG = $msgOptions[id]
LIMIT 1", __FILE__, __LINE__);
}
mysql_free_result($request);
Add after
// Floydpink INSERT - Add one to poster's post count
updateMemberData($changeposteridno, array('posts' => '+'));
Don't update ip address of modified post to that admin's IP
sources/subs-post.php
Find
while ($row = mysql_fetch_assoc($request))
{
db_query("
UPDATE {$db_prefix}messages
SET ID_MEMBER = ".$changeposteridno.", posterName = '".$row['memberName']."', posterEmail = '".$row['emailAddress']."', posterIP = '".$row['memberIP']."'
WHERE ID_MSG = $msgOptions[id]
LIMIT 1", __FILE__, __LINE__);
}
mysql_free_result($request);
Replace with
while ($row = mysql_fetch_assoc($request))
{
db_query("
UPDATE {$db_prefix}messages
SET ID_MEMBER = ".$changeposteridno.", posterName = '".$row['memberName']."', posterEmail = '".$row['emailAddress']."'
WHERE ID_MSG = $msgOptions[id]
LIMIT 1", __FILE__, __LINE__);
}
Quote from: floydpink on July 11, 2012, 08:38:14 AM
A couple of enhancements if anyone's interested:
SMF 1.1.16
Looks great! I may add it when we get working on the updates.
Mod page shows this was updated July 11, 2012 but it is still only showing as compatible with version 1.1.7 and it will not parse past that version. When will it be fully upgraded to support 2.0?
We are still researching the 2.x line. Most of the BK Modding Team has been away for a few years. I for one had been completely offline for that time. So far, we managed to get the 1.x version mods updated, now we need to get used to the changes in the 2.x SMF system before we can get to updating. Hopefully, that will be soon.
HTMLstig and I are also very busy off-line, so things may be a little slower than before. We apologize for any inconvenience. Any coder that would like to help out and maybe join the BK Modding team, can PM me here and we'll talk.
No problem, just wanted to get clarification on it. :). Thanks for continuing to work on them.
I could really use this mod for 2.02. I have been searching and see that several people have worked on it and then stopped. What's the status? Can I get this mod for 2.02?
If anyone has updated this for their own use to SMF 2.0 line, please PM me, so we can discus posting it and giving credit. Otherwise, it may take a while to get this mod updated, due to the changes involved between 1.x and 2.x lines.
If need support for this mod, please go to BurkeKnight Enterprises (http://www.burkeknight.com/) and register there.
We have a support ticket system for mod support.
We will no longer be supporting this mod here at the SMF site,
as we feel it is easier to keep all support at our site.