How to install Plugins so they don't conflict with new Sngine releases?

Jason Gill
Member
Ingresó: 2025-01-12 07:46:19
2025-01-12 08:15:16

How to install your modules on Sngine so they don't conflict and/or get overwritten by new Sngine versions?  

The problem with alot of mods is that they conflict with SNGINE core files.   How does your module system work so that they don't get overwritten when new versions of Sngine are released?   

MakeMyTheme Admin
Admin
Ingresó: 2024-12-27 09:02:43
2025-01-12 08:33:26

Dear Jason,

After 8 long years association with sngine and its development, my focus on all the modules we will share here is to allow minmum touch to the core code files. 

this module, the birthday box would not be in conflict with any of the features whatsoever. Yes it does require manual pasting of codes, but it does not ask you to edit or disrupt any existing code block. 

your codes are to be placed in line with other existing code. So no trouble, during next release of sngine, you need to follow the same instructions as this time and you would the plugin active again.

However in days to come, all our premium modules would be made to enable/update/install from your own website backend.

Thanks

Jason Gill
Member
Ingresó: 2025-01-12 07:46:19
2025-01-12 08:33:38

I just saw your install instructions for the Birthday Plugin.   It seems there are manual code overrides in there in class-user.php and index.php.   

With multiple mod overrides .. each Sngine version update becomes a real workload for code-challenged sngine operators.   I was hoping to put our heads together to figure out a way to do an automated patching system or something for new mods using a /custom folder.  

MakeMyTheme Admin
Admin
Ingresó: 2024-12-27 09:02:43
2025-01-12 08:41:01

Dont worry.. Place the codes as said and it does not ask you to edit any existing function. These codes in birthday block are separete code chunks and you need to place them after 

1. Place the function at the end of class-user.php .. bot before the last closing bracket

YOUR FUNCTION HERE 

}

and put it before the last closing bracket.

SIMILARLY - 2. Paste the code in tpl file  as a include line .. the view code would be inside widgets/ folder so no disruption

3. In index.php Place the smarty controller code, before any code lines

Like THIS

// get ads campaigns
    $ads_campaigns = $user->ads_campaigns();
    /* assign variables */
    $smarty->assign('ads_campaigns', $ads_campaigns);
  }

  // 01. Friends Birthday Plugin
$friends_birthday = $user->get_friends_birthday($user->_data['user_id']);
$smarty->assign('friends_birthday', $friends_birthday);

$current_date_birthday = (!empty($friends_birthday)) ? $friends_birthday[0] : null;

if ($current_date_birthday) {
    $smarty->assign('current_date_birthday', $current_date_birthday);

    // Pre-calculate birth day and month for the Smarty template
    $birth_day = date('d', strtotime($current_date_birthday['user_birthdate']));
    $birth_month = date('F', strtotime($current_date_birthday['user_birthdate']));

    $smarty->assign('birth_day', $birth_day);
    $smarty->assign('birth_month', $birth_month);
}

  // get trending hashtags
  if (!(!$user->_logged_in && !$system['newsfeed_public']) && $system['trending_hashtags_enabled']) {
    $trending_hashtags = $user->get_trending_hashtags();
    /* assign variables */
    $smarty->assign('trending_hashtags', $trending_hashtags);
  }



so wont be an issue.
Jason Gill
Member
Ingresó: 2025-01-12 07:46:19
2025-01-12 08:41:07

Okay .. great to hear that you are already thinking of some kind of install program for your modules.   updating SNGINE should be easier than running a DIFF tool everytime.   I was just learning how to use GIT Desktop for this task, because I need to make several mods to my Sngine to make it work for my needs.   

I tried using AI to help me write code to use a PHP class extend/wrap .. but I couldn't get it to work.   I think I lost half the hair on my head doing it.    All I was doing was trying to add geolocation data to the user_sessions table.   I know I can edit the code directly, but again .. now we have to re-mod every release.   what a bear.     

MakeMyTheme Admin
Admin
Ingresó: 2024-12-27 09:02:43
2025-01-12 08:42:12

Sngine does not work like wordpress and they dont have space for HOOKS in their core. So every module will have to have some or the other insert in the main code. 

In all our plugins we have kept it miminal and clean.

Jason Gill
Member
Ingresó: 2025-01-12 07:46:19
2025-01-12 08:49:11

I'm just trying to reduce the workload or each new SNGINE release with mods I want to add.  

In your previous reply you said: "However in days to come, all our premium modules would be made to enable/update/install from your own website backend."

Does that mean you have some "automated patching" system you are using to do the installs .. if so I'd like to see how it works ... because that would make each new version of Sngine much easier to reinstall any mods I do down the line.   

Either that, or I'd probably use Github Desktop to manage branch merges.  

These are all things most sngine ops will want anyways .. so maybe its something we can work on together .. which is what I think your concept is here.   

MakeMyTheme Admin
Admin
Ingresó: 2024-12-27 09:02:43
2025-01-12 12:40:56

Yes you are correct. Insert into original code can be made, with custom extended classes and keeping all files as includes or they have separate pages to work on altogether. So there would be no direct editing of any function to the main class and upgrading would be less hectic. Still there may remain few say very minor edits to add, saying 2% of code inserts and 9% of separate structure.... in certain features in case you wish to interrupt the core modules, some changes in feeds, and existing sngine pages. .. no other option that to make direct edit to those pages.

But that would always be, unless HOOKS like core changes are done, that only the Author team can do. 

and Yes, I am always open to new win win oppurtunities.