• Welcome to Simple Machines Community Forum. Please login or sign up.
September 22, 2021, 12:59:32 AM

News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord


Alternate User Posting

Started by Diego Andrés, July 28, 2010, 10:51:21 PM

Previous topic - Next topic

shadav

thank you....
well it installed without any errors but if I go to make a post i get
syntax error, unexpected 'array' (T_ARRAY)

shadav

Quote from: Diego Andrés on October 02, 2019, 01:03:41 AM
1.
Code (Search) Select
'current_member' => $original_id,
Code (Replace) Select
'current_member' => !empty($posterOptions['real_id']) ? $posterOptions['real_id'] : $original_id,,

2.
Code (Search) Select
array($topicOptions['id'], $original_id, $msgOptions['id']),
Code (Replace) Select
$topicOptions['id'], !empty($posterOptions['real_id']) ? $posterOptions['real_id'] : $original_id, $msgOptions['id'])

Haven't tested it tho
I think i got it :)

array($topicOptions['id'], !empty($posterOptions['real_id']) ? $posterOptions['real_id'] : $original_id, $msgOptions['id']),

at least everything seems to be working, I could be wrong

Diego Andrés

Sorry wasn't around, I supposed you'd do these edits after installing? Maybe I misread :P

SMF Tricks - Free & Premium Responsive Themes for SMF.

shadav

no you read fine :)
using your codes I was able to install it but then had an error when trying to use

you posted
$topicOptions['id'], !empty($posterOptions['real_id']) ? $posterOptions['real_id'] : $original_id, $msgOptions['id'])

but, I could be wrong, it needed to be
array($topicOptions['id'], !empty($posterOptions['real_id']) ? $posterOptions['real_id'] : $original_id, $msgOptions['id']),
this got rid of the error so I think it was correct hehehe (until it stops working at least)

GL700Wing

Earlier today I discovered that even though the 'Change User' option is displayed when a calendar event is being edited the owner of the event is not updated when an alternate user name is saved (only the owner of the topic is changed) and as a result a user can own a topic linked to an event they cannot edit/delete ...

The fix for this (ie, making the event owner the same as the topic owner when an alternate user name is saved) is very simple:

In ./Sources/Post.php
Find:
QuoteUPDATE {db_prefix}calendar
            SET end_date = {date:end_date},
Replace with:
QuoteUPDATE {db_prefix}calendar
            SET id_member = {int:id_member},
               end_date = {date:end_date},

Find:
Quotearray(
               'end_date' => strftime('%Y-%m-%d', $start_time + $span * 86400),
Replace with:
Quotearray(
               'id_member' => isset($alt_id) ? $alt_id : $user_info['id'],
               'end_date' => strftime('%Y-%m-%d', $start_time + $span * 86400),
Life doesn't have to be perfect to be wonderful ...

Diego Andrés

April 23, 2020, 07:54:17 PM #65 Last Edit: May 21, 2020, 05:17:16 PM by Diego Andrés
2.1 - 21 May 2020
Fixed missing text from admin help in permission.
Moved script code to main file, template removed.

2.0 - 23 April 2020
Spanish translation.
Mod is now using hooks.
Compatible with SMF 2.1.x.




Actually I have no clue if it works on RC2 but I hope it does ;D

SMF Tricks - Free & Premium Responsive Themes for SMF.

ABCDiamond

Hello.  I just want to say that this appears to be running well on an SMF 2.1 RC3, forum that I have started.

Advertisement: