insert image box

Started by sattninja, August 01, 2010, 02:13:27 PM

Previous topic - Next topic

sattninja

Hi when i disable the wysiwyg editor the little box does not come up anymore after clicking the insert image bbc button i really do not like using the editor is there a way to get the box to pop up when that is set to off ?

Running Rc4

sattninja

Running Rc4

sattninja

wow did i piss someone off or what not one response yet ?

Running Rc4

Kill Em All

sorry for getting to this late. We are all volunteers.

There is this mod:
http://custom.simplemachines.org/mods/index.php?mod=781

You may have to do some tinkering with it so it works with 2.0.


My Site: KEAGaming.com

Manual Installation of Mods
Prevent Spam and Forum Attacks
Please do not PM or email me for support unless offered, help should be publicly displayed to others.

sattninja

i know man i was just kidding thanks
Running Rc4

sattninja

#5
ok guys i need some help this mod seems very simple to instasll it is just 2 edits however i got an errors so i parsed it and this is what it says

Find:
      // Print a drop down list for all the colors we allow!

Add Before:
    // Java script to handle img input boxes ...
    echo '<script language="JavaScript" type="text/javascript">
          // <!' . '--
          function imgINPT()
  {
          // Enter image .........................................
          var imgLINK = prompt("Lütfen Resim adresini girin :","http://");
          if (imgLINK == null )
{
//cancel pressed . . .
          }
          else if (imgLINK == "" || imgLINK == " ")
{
//ok pressed but with Notext . . .
                  alert("Bir bilgi girilmedi!");
          }
          else
          {
    //ok pressed and there is something :)

//ok pressed but with notext so use URL only!
                    surroundText(\'[img]\'+imgLINK+\'\', \'[/img]\', document.', $context['post_form'], '.', $context['post_box_name'], ');
          }

          }
          // --' . '>
          </script>';


Find:
      foreach ($context['bbc_tags'][1] as $image => $tag)
{
if (isset($tag['before']))
{
// Is this tag disabled?
if (!empty($context['disabled_tags'][$tag['code']]))
continue;


Add After:
               // img popup by ghg
      if (isset($tag['code']) && $tag['code'] == 'img')
{
          echo '<a href="javascript:void(0);" onclick="imgINPT(); return false;"><img onmouseover="bbc_highlight(this, true);" onmouseout="if (window.bbc_highlight) bbc_highlight(this, false);" src="', $settings['images_url'], '/bbc/', $image, '.gif" align="bottom" width="23" height="22" alt="', $tag['description'], '" title="', $tag['description'], '" border="0" style="background-image: url(', $settings['images_url'], '/bbc/bbc_bg.gif); margin: 1px 2px 1px 1px;" /></a>';
continue;
}





you will see there are only 2 edits needed in the post.template.php  but i cannot find the it anywhere in the file i think maybe another mod i have removed it or something can someone please take a look i have attached my file

thank you




Running Rc4

mirahalo

that is because on 2.0 the posting templates changed a lot,  it needs a little bit of work to make this mod compatible with 2.0, let me see what I can do about it.

sattninja

Quote from: 130860 on August 11, 2010, 11:37:17 AM
that is because on 2.0 the posting templates changed a lot,  it needs a little bit of work to make this mod compatible with 2.0, let me see what I can do about it.

i really appreciate the help man but i don't understand what you mean i used the parser for RC2 and it is weird that there isnt anything like what is stated in my file
Running Rc4

mirahalo

what I mean is that on 2.0  the posting code are now handle with the file GenericControls.template.php  so you need to look on that file, I haven't look at it, once I get a chance I will post the edits so you can use that mod on a 2.0 forum

sattninja

ok kewl i will have a look also

thanks man 

Running Rc4

sattninja

i found it in there tried to mess with it and it screwed it up do i ill wait for you

thanks again
Running Rc4

mirahalo

ok, a friendly bump will help  if somehow I forget to look at ;)

or you can request a mod for it, in this cas an upgrade:   http://www.simplemachines.org/community/index.php?board=79.0


read the stickies on how to request and with some luck someone will do it :)

sattninja

bump
I have updated to RC3 can we get this this o work on RC3
Running Rc4

sattninja

i was able to find and do the first edit but i cannot find the string for the second edit i have attached thenew file with the first edit done can someone take a look for the second one

Find


foreach ($context['bbc_tags'][1] as $image => $tag)
      {
         if (isset($tag['before']))
         {
            // Is this tag disabled?
            if (!empty($context['disabled_tags'][$tag['code']]))
               continue;


Running Rc4

sattninja

 just downloaded the full install of RC3 and that string is not is the file from the install either so it isnt one of my mods or something that changed it which is what i initially thought it just doesn't exist
Running Rc4

sattninja

trying to revive this post

can someone gimme a hand with getting this working on RC3

thanks
Running Rc4

Kill Em All

Sorry for being delayed on this sattninja. Take a look at this mod that is built for 2.0.
http://arantormods.com/index.php?action=media;sa=item;in=3

Although it may be the URL popup, I'm gonna play around to see if I can get it to do a image popup instead.


My Site: KEAGaming.com

Manual Installation of Mods
Prevent Spam and Forum Attacks
Please do not PM or email me for support unless offered, help should be publicly displayed to others.

sattninja

ok thanks alot man i hope you get it

it is a great feature and i cannot stand the editor it screws up posts at least for me but i love the image pop up

thanks again
Running Rc4

Kill Em All

Yeah, the WYSIWYG editor is pretty buggy, but people should expect that for being a completely new part of SMF coding.


My Site: KEAGaming.com

Manual Installation of Mods
Prevent Spam and Forum Attacks
Please do not PM or email me for support unless offered, help should be publicly displayed to others.

sattninja

oh trust me it isn't only smf it is buggy on vbuletin as well at least in my experience

smf rocks man i really cannot believe the difference between RC2 and RC3 i held off on upgrading for too long i can't wait for the final
Running Rc4

Kill Em All

Alrighty, after working for a long time, haha, finally got it.

./Themes/default/scripts/editor.js
Code (find) Select

// Replace? if (!('sAfter' in oButtonProperties) || oButtonProperties.sAfter == null) 


Code (replace) Select

// IMG popup?
if (oButtonProperties.sCode == 'img')
{
// Ask them where to link to.
var sText = prompt(oEditorStrings['prompt_text_url'], 'http://');
if (!sText)
return;

var bbcode = '[img]' + sText + '[/img]';
replaceText(bbcode.replace(/\\n/g, '\n'), this.oTextHandle);
}
// Replace?
else if (!('sAfter' in oButtonProperties) || oButtonProperties.sAfter == null)


./Sources/Subs-Editor.php

Code (find) Select

prompt_text_img: \'' . addcslashes($txt['prompt_text_img'], "'") . '\' 


Code (add after) Select

,
prompt_text_desc: \'' . addcslashes($txt['prompt_text_desc'], "'") . '\' 


./Themes/default/languages/Modifications.english.php

Code (find) Select

?>


Code (add before) Select

$txt['prompt_text_desc'] = 'Please enter what text the link should say.';


I could just give you the package but I don't think the mod author would like that to much. Thanks Arantor for creating the URL links, came in handy. :)


My Site: KEAGaming.com

Manual Installation of Mods
Prevent Spam and Forum Attacks
Please do not PM or email me for support unless offered, help should be publicly displayed to others.

sattninja

no problem let me see if i can get this going

i will report back thanks man
Running Rc4

sattninja

worked like a freakin dream man thanks this should be made into a package

thanks again man much appreciated
Running Rc4

Kill Em All

I'll ask the big man himself if I can redistribute it as a mod.

edit: I'm gonna mark this solved.


My Site: KEAGaming.com

Manual Installation of Mods
Prevent Spam and Forum Attacks
Please do not PM or email me for support unless offered, help should be publicly displayed to others.

sattninja

Running Rc4

Advertisement: