Thread Rating:
  • 45 Vote(s) - 3.73 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Not Solved Script to Update Plugins for 1.6.5
#11
Not Solved
(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.
Reply
#12
Not Solved
(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.
Reply
#13
Not Solved
(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?
Reply
#14
Not Solved
the original post (http://community.mybb.com/thread-106729-post-777848.html#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.
Reply
#15
Not Solved
(11-30-2011, 12:50 AM)pavemen Wrote:  the original post (http://community.mybb.com/thread-106729-post-777848.html#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.15 X3:
7173Mustangs.com, pa2a.org & PAZRT.com
Reply
#16
Not Solved
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.
Reply
#17
Not Solved
Thanks for the script pavemen it helped me upgrading my plugins.

+ Rep
Reply
#18
Not Solved
(11-30-2011, 12:50 AM)pavemen Wrote:  the original post (http://community.mybb.com/thread-106729-post-777848.html#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
Reply
#19
Not Solved
(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.
Reply
#20
Not Solved
(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 .
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)