Current time: 04-23-2014, 02:39 PM Hello There, Guest! (LoginRegister)


Post Reply 
 
Thread Rating:
  • 45 Votes - 3.73 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script to Update Plugins for 1.6.5
11-29-2011, 10:19 PM
Post: #11
Not Solved RE: Script to Update Plugins for 1.6.5
(11-29-2011 10:13 PM)Pirata Nervo Wrote:  Someone PM'd me that this script was saying that MyAdvertisements required to be updated but MyAdvertisements always used receiving by reference. Either your script is failing somewhere or something else is happening.

Oh and this was the function it mentioned:
PHP Code:
function myadvertisements_postbit_disable(&$post)
{
    global 
$mybb$templates;
    
    
$cachetemps = array();
    
    if(!
$templates->cache['postbit'])
        
$cachetemps[] = 'postbit';
        
    if(!
$templates->cache['postbit_classic'])
        
$cachetemps[] = 'postbit_classic';
    
    if (!empty(
$cachetemps))
        
$templates->cache(implode(','$cachetemps));
        
    if (!isset(
$mypostcounter))
        
$mypostcounter 0;
        
    static 
$postbit_backup '';
    static 
$postbit_classic_backup '';
    
    
// Fix purposed by Yumi/Zinga
    // http://mybbhacks.zingaburga.com/showthread.php?tid=572&pid=5133#pid5133
    
static $restore_postbit null;
    if (empty(
$postbit_backup) || $restore_postbit)
    {
        
$viewmode = ($mybb->settings['postlayout'] == 'classic' '_classic' '');
        
$restore_postbit = (
            !isset(
$restore_postbit)
            && isset(
$templates->cache['postbit_first'.$viewmode])
            && 
$templates->cache['postbit_first'.$viewmode] == $templates->cache['postbit'.$viewmode]
        );
        
$postbit_backup $templates->cache['postbit'];
        
$postbit_classic_backup $templates->cache['postbit_classic'];
    }
    
    
$templates->cache['postbit'] = str_replace('{myadvertisements[zone_3]}'''$postbit_backup);
    
$templates->cache['postbit_classic'] = str_replace('{myadvertisements[zone_3]}'''$postbit_classic_backup);



they may be using the old version that only indicated that a plugin uses one of the hooks listed as effected by the 1.6.5 changes and lists the filename, hook name and function name referenced by the hook. It was not smart enough to know if the fix was actually needed. That was explained several times in the original thread. The person that contacted you did not read the whole original thread.

This new version actually checks if the "&" is there already and updates the local file if it is not.

Personal site: CommunityPlugins.com

Please do not PM me for MyBB support here. Use the forums, they are here for a reason. Thanks.
Visit this user's website Find all posts by this user
Quote this message in a reply
11-29-2011, 10:22 PM
Post: #12
Not Solved RE: Script to Update Plugins for 1.6.5
(11-29-2011 10:19 PM)pavemen Wrote:  
(11-29-2011 10:13 PM)Pirata Nervo Wrote:  Someone PM'd me that this script was saying that MyAdvertisements required to be updated but MyAdvertisements always used receiving by reference. Either your script is failing somewhere or something else is happening.

Oh and this was the function it mentioned:
PHP Code:
function myadvertisements_postbit_disable(&$post)
{
    global 
$mybb$templates;
    
    
$cachetemps = array();
    
    if(!
$templates->cache['postbit'])
        
$cachetemps[] = 'postbit';
        
    if(!
$templates->cache['postbit_classic'])
        
$cachetemps[] = 'postbit_classic';
    
    if (!empty(
$cachetemps))
        
$templates->cache(implode(','$cachetemps));
        
    if (!isset(
$mypostcounter))
        
$mypostcounter 0;
        
    static 
$postbit_backup '';
    static 
$postbit_classic_backup '';
    
    
// Fix purposed by Yumi/Zinga
    // http://mybbhacks.zingaburga.com/showthread.php?tid=572&pid=5133#pid5133
    
static $restore_postbit null;
    if (empty(
$postbit_backup) || $restore_postbit)
    {
        
$viewmode = ($mybb->settings['postlayout'] == 'classic' '_classic' '');
        
$restore_postbit = (
            !isset(
$restore_postbit)
            && isset(
$templates->cache['postbit_first'.$viewmode])
            && 
$templates->cache['postbit_first'.$viewmode] == $templates->cache['postbit'.$viewmode]
        );
        
$postbit_backup $templates->cache['postbit'];
        
$postbit_classic_backup $templates->cache['postbit_classic'];
    }
    
    
$templates->cache['postbit'] = str_replace('{myadvertisements[zone_3]}'''$postbit_backup);
    
$templates->cache['postbit_classic'] = str_replace('{myadvertisements[zone_3]}'''$postbit_classic_backup);



they may be using the old version that only indicated that a plugin uses one of the hooks listed as effected by the 1.6.5 changes and lists the filename, hook name and function name referenced by the hook. It was not smart enough to know if the fix was actually needed. That was explained several times in the original thread. The person that contacted you did not read the whole original thread.

This new version actually checks if the "&" is there already and updates the local file if it is not.

Ah I should have supposed that. People don't read entire threads these days.


PM me for custom plugins.
Visit this user's website Find all posts by this user
Quote this message in a reply
11-30-2011, 12:35 AM
Post: #13
Not Solved RE: Script to Update Plugins for 1.6.5
(11-29-2011 10:22 PM)Pirata Nervo Wrote:  Ah I should have supposed that. People don't read entire threads these days.

This is why the original thread is locked. I should really edit the first post though and post pavemen's script there.

If thats OK with you Pave?

CodeWeavers - CrossOver: Windows Compatibility on Macintosh and Linux
[Image: Advocate_125.png]
Doesn't like unsolicited PMs
Find all posts by this user
Quote this message in a reply
11-30-2011, 12:50 AM (This post was last modified: 11-30-2011 12:51 AM by pavemen.)
Post: #14
Not Solved RE: Script to Update Plugins for 1.6.5
the original post (http://community.mybb.com/thread-106729-...pid777848) has been tweaked by Paul already and the attachment in this thread is correct/current
but, yes, if you want to add a link to this thread in Dylan's original thread on this subject, feel free. The more visible this solution is, the fewer support requests (hopefully)

Personal site: CommunityPlugins.com

Please do not PM me for MyBB support here. Use the forums, they are here for a reason. Thanks.
Visit this user's website Find all posts by this user
Quote this message in a reply
11-30-2011, 01:44 AM
Post: #15
Not Solved RE: Script to Update Plugins for 1.6.5
(11-30-2011 12:50 AM)pavemen Wrote:  the original post (http://community.mybb.com/thread-106729-...pid777848) has been tweaked by Paul already and the attachment in this thread is correct/current
but, yes, if you want to add a link to this thread in Dylan's original thread on this subject, feel free. The more visible this solution is, the fewer support requests (hopefully)

I used the script and it was quick and easy! Just follow Pave's directions above! no problems!!

MyBB 1.6.12 X3:
7173Mustangs.com, pa2a.org & PAZRT.com
Visit this user's website Find all posts by this user
Quote this message in a reply
11-30-2011, 10:44 AM (This post was last modified: 11-30-2011 11:13 AM by fakhrul.)
Post: #16
Not Solved RE: Script to Update Plugins for 1.6.5
work great!

[Image: hookupdate.jpg]

Thanks pave

/edit.

After using this hookupdate , i found that some of the plugins not work.
For example tagging plugin ( http://mods.mybb.com/view/tagging-plugin ) doesnt appear in plugins configuration menu. I check that the hook plugins remove the script in inc/plugins/tagging.php .

So , i download the new one , open it in WorPad , using find function ( ctrl + F ) to find function script. After that simply add the & before $

for example :

PHP Code:
function tagging_get_user($p

simply add & to make it like this

PHP Code:
function tagging_get_user(&$p

read at first post of pave , u will know how to do this.

tagging plugins that i have update can be found here : http://pastebin.com/ptTV1Yk5

Thanks for all.
Visit this user's website Find all posts by this user
Quote this message in a reply
11-30-2011, 12:13 PM
Post: #17
Not Solved RE: Script to Update Plugins for 1.6.5
Thanks for the script pavemen it helped me upgrading my plugins.

+ Rep
Visit this user's website Find all posts by this user
Quote this message in a reply
11-30-2011, 03:57 PM
Post: #18
Not Solved RE: Script to Update Plugins for 1.6.5
(11-30-2011 12:50 AM)pavemen Wrote:  the original post (http://community.mybb.com/thread-106729-...pid777848) has been tweaked by Paul already and the attachment in this thread is correct/current
but, yes, if you want to add a link to this thread in Dylan's original thread on this subject, feel free. The more visible this solution is, the fewer support requests (hopefully)

Done
http://community.mybb.com/thread-106729.html

CodeWeavers - CrossOver: Windows Compatibility on Macintosh and Linux
[Image: Advocate_125.png]
Doesn't like unsolicited PMs
Find all posts by this user
Quote this message in a reply
11-30-2011, 05:06 PM
Post: #19
Not Solved RE: Script to Update Plugins for 1.6.5
(11-30-2011 10:44 AM)fakhrul Wrote:  work great!

[Image: hookupdate.jpg]

Thanks pave

/edit.

After using this hookupdate , i found that some of the plugins not work.
For example tagging plugin ( http://mods.mybb.com/view/tagging-plugin ) doesnt appear in plugins configuration menu. I check that the hook plugins remove the script in inc/plugins/tagging.php .

So , i download the new one , open it in WorPad , using find function ( ctrl + F ) to find function script. After that simply add the & before $

for example :

PHP Code:
function tagging_get_user($p

simply add & to make it like this

PHP Code:
function tagging_get_user(&$p

read at first post of pave , u will know how to do this.

tagging plugins that i have update can be found here : http://pastebin.com/ptTV1Yk5

Thanks for all.

You don't need to add the "&" everytime there is a "$" in a function call.

I fixed the script to deal with what was causing the problem with this plugin, it was not dealing with inline comments to the add_hooks lines when searching for the functions to modify. This is what was breaking the plugin after the update.

The new script is attached to the first post, sorry for the problem

Personal site: CommunityPlugins.com

Please do not PM me for MyBB support here. Use the forums, they are here for a reason. Thanks.
Visit this user's website Find all posts by this user
Quote this message in a reply
11-30-2011, 07:22 PM
Post: #20
Not Solved RE: Script to Update Plugins for 1.6.5
(11-30-2011 05:06 PM)pavemen Wrote:  You don't need to add the "&" everytime there is a "$" in a function call.

I fixed the script to deal with what was causing the problem with this plugin, it was not dealing with inline comments to the add_hooks lines when searching for the functions to modify. This is what was breaking the plugin after the update.

The new script is attached to the first post, sorry for the problem

thats why after update the script dissapear. Thanks again pave .
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)

Contact Us | MyBB | Return to Top | Return to Content | Lite (Archive) Mode | RSS Syndication