We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Extension: Publish Tweeks

Development and Programming

Brian Litzinger's avatar
Brian Litzinger
693 posts
16 years ago
Brian Litzinger's avatar Brian Litzinger

The extension adds a nice touch, but I ran into an odd issue. See this thread:

http://ellislab.com/forums/viewthread/106076/

       
notacouch's avatar
notacouch
92 posts
16 years ago
notacouch's avatar notacouch
The extension adds a nice touch, but I ran into an odd issue. See this thread: http://ellislab.com/forums/viewthread/106076/

It is probably the same isolated bug I got with sequential gallery related entries.

I changed the regex slightly and that did the trick. If the author doesn’t mind I’ll post the edit for that.

How I managed to bring it down to that is the returned html is via preg_replace, when that function fails it returns NULL (iirc). In my own code I forgot to check if the preg replace fails but changing the regex somehow did the trick (makes no sense since the html it is searching is exactly the same).

       
rockthenroll's avatar
rockthenroll
485 posts
16 years ago
rockthenroll's avatar rockthenroll

@tilzinger sorry for the trouble, we’ll look at the issue @notacouch go ahead and post and we’ll look at your edit for the next version. Thanks!

       
notacouch's avatar
notacouch
92 posts
16 years ago
notacouch's avatar notacouch

Publish Tweeks 0.7.2

$new = 'div class="submitBox">
      <input class="submit" type="submit" value="' . $value . '" name="submit" /></div>
      <div class="uploadBox"';
$find = "#div class='submitBox'.+div class='uploadBox'#is";
return preg_replace($find, $new, $html);

My ‘fix’ (now updated to work around preg_replace errors)

$new = 'div class="submitBox">
        <input class="submit" type="submit" value="' . $value . '" name="submit" /></div>';

    $find = "#div class='submitBox'.+?</div>#is";

    $temp_html = preg_replace($find, $new, $html);
    $html = ($temp_html === NULL ) ? $html : $temp_html;

    return $html;
       
notacouch's avatar
notacouch
92 posts
16 years ago
notacouch's avatar notacouch

If you want to add a setting to remove the Upload File box:

Replace in ext.publish_tweeks.php (in the fix above)

return $html;

with

// Remove upload box?
    if( isset( $this->settings['other_settings_remove_upload_box'] ) AND ( $this->settings['other_settings_remove_upload_box'] === 'y' ) )
    {
        $new = '';
        $find = "#<div class='uploadBox'.+?</div>#is";
        $temp_html = preg_replace($find, $new, $html);
        $html = ($temp_html === NULL ) ? $html : $temp_html;
    }
    
    return $html;

and

// Close Form

With

// Other Settings

    $DSP->body .= $DSP->table_open(
                                       array(
                                           'class'  => 'tableBorder',
                                           'border' => '0',
                                           'style' => 'margin-top:18px; width:100%'
                                       )
                                   );

    $DSP->body .= $DSP->tr()
                . $DSP->td('tableHeading', '', '2')
                . $LANG->line("other_settings_title")
                . $DSP->td_c()
                . $DSP->tr_c();

    $DSP->body .= $DSP->tr()
                . $DSP->td('tableCellOne', '60%')
                . $DSP->qdiv('defaultBold', $LANG->line("other_settings_remove_upload_box_label"))
                . $DSP->td_c();

    $DSP->body .= $DSP->td('tableCellOne')
                . '<select name="other_settings_remove_upload_box">'
                . $DSP->input_select_option('y', $LANG->line('yes'), ($current['other_settings_remove_upload_box'] == 'y' ? 'y' : ''))
                . $DSP->input_select_option('n', $LANG->line('no'),  ($current['other_settings_remove_upload_box'] != 'y' ? 'y' : ''))
                . $DSP->input_select_footer()
                . $DSP->td_c()
                . $DSP->tr_c();

    $DSP->body .= $DSP->table_c();
    
    // Close Form

in language/english/lang.publish_tweeks.php:

replace

/* END */

with

// -- Other settings

'other_settings_title' =>
'Other Settings',

'other_settings_remove_upload_box_label' =>
'Remove "Upload File" box?',

/* END */
       
Ryan Blaind's avatar
Ryan Blaind
168 posts
16 years ago
Ryan Blaind's avatar Ryan Blaind

I think I found an issue with this extension and the Playa extension. While this was enabled, any weblogs that have more than 1 playa field just output a blank cp screen. tried updating to 0.7.2, same result. Just FYI

       
notacouch's avatar
notacouch
92 posts
16 years ago
notacouch's avatar notacouch
I think I found an issue with this extension and the Playa extension. While this was enabled, any weblogs that have more than 1 playa field just output a blank cp screen. tried updating to 0.7.2, same result. Just FYI

try the above modification? http://ellislab.com/forums/viewreply/534348/

       
Ryan Blaind's avatar
Ryan Blaind
168 posts
16 years ago
Ryan Blaind's avatar Ryan Blaind

No, I just read through it, isn’t that just so you can have the ability to remove the upload file functionality?

I was saying that this extension afaik is conflicting with the Playa extension when you have more than 1 playa field in your field group. Would the above mod fix this?

       
notacouch's avatar
notacouch
92 posts
16 years ago
notacouch's avatar notacouch
No, I just read through it, isn’t that just so you can have the ability to remove the upload file functionality? I was saying that this extension afaik is conflicting with the Playa extension when you have more than 1 playa field in your field group. Would the above mod fix this?

Check post #33. I had a similar problem with sequential related gallery dropdowns, the mod in #33 fixed it for me. the post after that is if you want to add the option to remove upload file via a setting.

       
Ryan Blaind's avatar
Ryan Blaind
168 posts
16 years ago
Ryan Blaind's avatar Ryan Blaind

hey man, thanks a lot. That fixed it actually. Much appreciated! cheers

       
notacouch's avatar
notacouch
92 posts
16 years ago
notacouch's avatar notacouch

np glad it’s basically the same problem we’re all having or rather the ‘solution’ is a one size fits all sorta thing.

       
Laisvunas's avatar
Laisvunas
879 posts
16 years ago
Laisvunas's avatar Laisvunas

Wiki’ed.

       
Brian M.'s avatar
Brian M.
529 posts
16 years ago
Brian M.'s avatar Brian M.

I’ve found a pretty serious bug with 0.7.2 (not sure about other versions). By default, the system will truncate textareas in the CP so you can’t get more text in there than MySQL will allow. With this extension enabled, it appears this doesn’t happen - it will allow you to enter more characters than MySQL will allow. If you go back and try to edit your entry again all you get in the CP is a blank white page - no PHP errors, no nothing. The front end of the website will show the content so it isn’t quite as bad, but you can’t get back in to edit at all (you have to go into MySQL and modify the field manually).

I’ve just turned off the extension for now and everything is back to normal, but would love to know when it’s fixed.

Thanks!

       
Matt Weinberg's avatar
Matt Weinberg
489 posts
16 years ago
Matt Weinberg's avatar Matt Weinberg
I get this error when I get to the Edit page: Notice: A session had already been started - ignoring session_start() in /home/xxxxxx/public_html/xxxxx/extensions/ext.publish_tweeks.php on line 151

FYI– I fixed this by doing the following to both session_start() lines:

if (session_id() == "") {
    session_start();
}
       
rockthenroll's avatar
rockthenroll
485 posts
16 years ago
rockthenroll's avatar rockthenroll

New Release 0.8!

http://www.ngenworks.com/software/ee/publish-tweeks/

CHANGELOG

• Redesigned the message area when an entry is updated to be more noticeable • Bug fix: suppress session_start notice message • Bug fix: moved button text to language file • Bug fix: moved update/saved message to language file

       
1 2 3 4 5

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.