The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Select Content don't work on my forum

View previous topic View next topic Go down

Solved Select Content don't work on my forum

Post by isnanz on September 1st 2011, 3:58 am


isnanz
Forumember

Male Posts : 206
Reputation : 0
Language : Indonesian
Location : Indonesia

http://help.forumotion.com

Back to top Go down

Solved Re: Select Content don't work on my forum

Post by Base on September 1st 2011, 11:40 am

Hi, did you use the 'phpBB 2' code? You will also need to set its placement to all pages. Smile

Base
Forumaster

Male Posts : 10386
Reputation : 1687
Language : English and French
Location : United Kingdom, England

http://forumotionhub.net

Back to top Go down

Solved Re: Select Content don't work on my forum

Post by isnanz on September 1st 2011, 3:36 pm

@Base wrote:Hi, did you use the 'phpBB 2' code? You will also need to set its placement to all pages. Smile

didn't work

isnanz
Forumember

Male Posts : 206
Reputation : 0
Language : Indonesian
Location : Indonesia

http://help.forumotion.com

Back to top Go down

Solved Re: Select Content don't work on my forum

Post by Base on September 1st 2011, 6:22 pm

It's working for me. Perhaps you have added it wrong... please try again.

Base
Forumaster

Male Posts : 10386
Reputation : 1687
Language : English and French
Location : United Kingdom, England

http://forumotionhub.net

Back to top Go down

Solved Re: Select Content don't work on my forum

Post by isnanz on September 1st 2011, 6:26 pm

@Base wrote:It's working for me. Perhaps you have added it wrong... please try again.

like this..



but still didn't work...

isnanz
Forumember

Male Posts : 206
Reputation : 0
Language : Indonesian
Location : Indonesia

http://help.forumotion.com

Back to top Go down

Solved Re: Select Content don't work on my forum

Post by Base on September 1st 2011, 6:41 pm

Where are your Forumotion links? Do NOT remove them unless you've paid. Even then, the phpBB link must still be there. Evil or Very Mad

Are you sure that your forum version is phpBB 2?

Base
Forumaster

Male Posts : 10386
Reputation : 1687
Language : English and French
Location : United Kingdom, England

http://forumotionhub.net

Back to top Go down

Solved Re: Select Content don't work on my forum

Post by isnanz on September 1st 2011, 7:51 pm

certainly..

this is

isnanz
Forumember

Male Posts : 206
Reputation : 0
Language : Indonesian
Location : Indonesia

http://help.forumotion.com

Back to top Go down

Solved Re: Select Content don't work on my forum

Post by isnanz on September 2nd 2011, 3:02 pm

up

isnanz
Forumember

Male Posts : 206
Reputation : 0
Language : Indonesian
Location : Indonesia

http://help.forumotion.com

Back to top Go down

Solved Re: Select Content don't work on my forum

Post by Darren1 on September 3rd 2011, 5:42 am

Hi,

I don't know why this is happening?
Could you please remove the code all together and leave it as either blank or with just a "." in it.
Save it.
Then remove the "." and insert this code.
Code:
 
function selectCode(a)
        {
        // Get ID of code block
        var e = jQuery(a).closest('tr').next().find('.cont_code')[0];

        // Not IE
        if (window.getSelection)
        {
        var s = window.getSelection();
        // Safari
        if (s.setBaseAndExtent)
        {
        s.setBaseAndExtent(e, 0, e, e.innerText.length - 1);
        }
        // Firefox and Opera
        else
        {
        // workaround for bug # 42885
        if (window.opera && e.innerHTML.substring(e.innerHTML.length - 4) == '<BR>')
        {
        e.innerHTML = e.innerHTML + ' ';
        }

        var r = document.createRange();
        r.selectNodeContents(e);
        s.removeAllRanges();
        s.addRange(r);
        }
        }
        // Some older browsers
        else if (document.getSelection)
        {
        var s = document.getSelection();
        var r = document.createRange();
        r.selectNodeContents(e);
        s.removeAllRanges();
        s.addRange(r);
        }
        // IE
        else if (document.selection)
        {
        var r = document.body.createTextRange();
        r.moveToElementText(e);
        r.select();
        }
        }
        jQuery(function(){

        jQuery('div.postbody td.code').parent().prev().find('b').html('Code:
        <a href="javascript:void()" onClick="selectCode(this)"><font
        face="verdana" color="red"></font> Select Content </a>');
        });

Save again and it should work Smile

Darren1
Helper
Helper

Male Posts : 11853
Reputation : 563
Language : English

Back to top Go down

Solved Re: Select Content don't work on my forum

Post by isnanz on September 3rd 2011, 6:21 pm

@Darren1 wrote:Hi,

I don't know why this is happening?
Could you please remove the code all together and leave it as either blank or with just a "." in it.
Save it.
Then remove the "." and insert this code.
Code:
 
function selectCode(a)
        {
        // Get ID of code block
        var e = jQuery(a).closest('tr').next().find('.cont_code')[0];

        // Not IE
        if (window.getSelection)
        {
        var s = window.getSelection();
        // Safari
        if (s.setBaseAndExtent)
        {
        s.setBaseAndExtent(e, 0, e, e.innerText.length - 1);
        }
        // Firefox and Opera
        else
        {
        // workaround for bug # 42885
        if (window.opera && e.innerHTML.substring(e.innerHTML.length - 4) == '<BR>')
        {
        e.innerHTML = e.innerHTML + ' ';
        }

        var r = document.createRange();
        r.selectNodeContents(e);
        s.removeAllRanges();
        s.addRange(r);
        }
        }
        // Some older browsers
        else if (document.getSelection)
        {
        var s = document.getSelection();
        var r = document.createRange();
        r.selectNodeContents(e);
        s.removeAllRanges();
        s.addRange(r);
        }
        // IE
        else if (document.selection)
        {
        var r = document.body.createTextRange();
        r.moveToElementText(e);
        r.select();
        }
        }
        jQuery(function(){

        jQuery('div.postbody td.code').parent().prev().find('b').html('Code:
        <a href="javascript:void()" onClick="selectCode(this)"><font
        face="verdana" color="red"></font> Select Content </a>');
        });

Save again and it should work Smile


still didn't work..

http://limadua.forumotion.com/t684-test-code-and-select-content


isnanz
Forumember

Male Posts : 206
Reputation : 0
Language : Indonesian
Location : Indonesia

http://help.forumotion.com

Back to top Go down

Solved Re: Select Content don't work on my forum

Post by DarkBlade on September 3rd 2011, 8:35 pm

It may just be a simple code typo, re-read the code and check for any typos.

DarkBlade
Forumember

Posts : 206
Reputation : 14
Language : English

Back to top Go down

Solved Re: Select Content don't work on my forum

Post by Zack. on September 4th 2011, 12:48 pm

The code for phpbb2 doesn't work for me too

Zack.
Forumember

Male Posts : 26
Reputation : 6
Language : Romanian/English/French
Location : Sibu, Romania

http://global4um.net

Back to top Go down

Solved Re: Select Content don't work on my forum

Post by Base on September 4th 2011, 12:50 pm

DarkStar. wrote:The code for phpbb2 doesn't work for me too

Well, in your profile details it says you're running on phpBB 3. So maybe perhaps use the other one...? Laughing

Base
Forumaster

Male Posts : 10386
Reputation : 1687
Language : English and French
Location : United Kingdom, England

http://forumotionhub.net

Back to top Go down

Solved Re: Select Content don't work on my forum

Post by Zack. on September 4th 2011, 2:14 pm

My forum is phpbb3, but i put this code on a phpbb2 test forum and it doesn't work

Zack.
Forumember

Male Posts : 26
Reputation : 6
Language : Romanian/English/French
Location : Sibu, Romania

http://global4um.net

Back to top Go down

Solved Re: Select Content don't work on my forum

Post by Ahmedvirus on September 4th 2011, 3:37 pm

Try to experiment with this

phpbb2
Code:
        function selectCode(a){a=a.parentNode.tagName==="B"?$(a).closest("table").find(".cont_code")[0]:$(a).closest("dl").find("code")[0];if(window.getSelection){var c=window.getSelection();if(c.setBaseAndExtent)c.setBaseAndExtent(a,0,a,a.innerText.length-1);else{window.opera&&a.innerHTML.substring(a.innerHTML.length-4)=="<BR>"&&(a.innerHTML+=" ");var b=document.createRange();b.selectNodeContents(a);c.removeAllRanges();c.addRange(b)}}else document.getSelection?(c=document.getSelection(),b=document.createRange(),b.selectNodeContents(a),
        c.removeAllRanges(),c.addRange(b)):document.selection&&(b=document.body.createTextRange(),b.moveToElementText(a),b.select())}
       
        $(function(){
            $("dl.codebox:not(.spoiler,.hidecode) dt").add($("div.cont_code").closest("table").find("span.genmed b")).append('<span onClick="selectCode(this)" class="selectCode">Sélectionner le contenu</span>');
        });

and add this to css

Code:
        .selectCode { float:right; text-transform: uppercase; cursor:pointer; }

and this to phpbb3
Code:
    function selectCode(a)
        {
          // Get ID of code block
          var e = a.parentNode.parentNode.getElementsByTagName('CODE')[0];
     
          // Not IE
          if (window.getSelection)
          {
              var s = window.getSelection();
              // Safari
              if (s.setBaseAndExtent)
              {
                s.setBaseAndExtent(e, 0, e, e.innerText.length - 1);
              }
              // Firefox and Opera
              else
              {
                // workaround for bug # 42885
                if (window.opera && e.innerHTML.substring(e.innerHTML.length - 4) == '<BR>')
                {
                    e.innerHTML = e.innerHTML + ' ';
                }
     
                var r = document.createRange();
                r.selectNodeContents(e);
                s.removeAllRanges();
                s.addRange(r);
              }
          }
          // Some older browsers
          else if (document.getSelection)
          {
              var s = document.getSelection();
              var r = document.createRange();
              r.selectNodeContents(e);
              s.removeAllRanges();
              s.addRange(r);
          }
          // IE
          else if (document.selection)
          {
              var r = document.body.createTextRange();
              r.moveToElementText(e);
              r.select();
          }
        }
        if(text){}else{ var text = 'Selecionar todos';}
        jQuery(document).ready(function(){
          jQuery("dl.codebox dt").not("dl.spoiler > dt").html('Code: <a href="#" onclick="selectCode(this); return false;" title="Select all the content" class="code-a"> Select Content </a>');
        });

Step 1:
Navigate to...
Administration Panel → Modules Tab → Javascript codes management → Create a new javascript

Step 2:
Call it whatever you like and set its placement to all pages.

Ahmedvirus
Forumember

Male Posts : 321
Reputation : 59
Language : English

http://help.forumotion.com

Back to top Go down

Solved Re: Select Content don't work on my forum

Post by Zack. on September 4th 2011, 7:47 pm

Sorry, this code is not working too

Zack.
Forumember

Male Posts : 26
Reputation : 6
Language : Romanian/English/French
Location : Sibu, Romania

http://global4um.net

Back to top Go down

Solved Re: Select Content don't work on my forum

Post by Ahmedvirus on September 5th 2011, 1:07 am

May not be the problem of code
Perhaps the problem is in your board
These codes work well , Perhaps you put codes incorrectly
Because it seems puzzling , How to not working with you !!
Try to check in more action steps the code

Greetings Smile

Ahmedvirus
Forumember

Male Posts : 321
Reputation : 59
Language : English

http://help.forumotion.com

Back to top Go down

Solved Re: Select Content don't work on my forum

Post by Zack. on September 5th 2011, 8:47 am

I put the codes corectly, i am sure. Take a look here: http://test2010.forumgratuit.ro/t9-sasdasdsadsadasdadsf#16
It's not working

Zack.
Forumember

Male Posts : 26
Reputation : 6
Language : Romanian/English/French
Location : Sibu, Romania

http://global4um.net

Back to top Go down

Solved Re: Select Content don't work on my forum

Post by Base on September 5th 2011, 10:46 am

Could it be that you have some other coding on your forum which could be conflicting this?

Base
Forumaster

Male Posts : 10386
Reputation : 1687
Language : English and French
Location : United Kingdom, England

http://forumotionhub.net

Back to top Go down

Solved Re: Select Content don't work on my forum

Post by isnanz on September 5th 2011, 6:08 pm

@Ahmedvirus wrote:Try to experiment with this

phpbb2
Code:
        function selectCode(a){a=a.parentNode.tagName==="B"?$(a).closest("table").find(".cont_code")[0]:$(a).closest("dl").find("code")[0];if(window.getSelection){var c=window.getSelection();if(c.setBaseAndExtent)c.setBaseAndExtent(a,0,a,a.innerText.length-1);else{window.opera&&a.innerHTML.substring(a.innerHTML.length-4)=="<BR>"&&(a.innerHTML+=" ");var b=document.createRange();b.selectNodeContents(a);c.removeAllRanges();c.addRange(b)}}else document.getSelection?(c=document.getSelection(),b=document.createRange(),b.selectNodeContents(a),
        c.removeAllRanges(),c.addRange(b)):document.selection&&(b=document.body.createTextRange(),b.moveToElementText(a),b.select())}
       
        $(function(){
            $("dl.codebox:not(.spoiler,.hidecode) dt").add($("div.cont_code").closest("table").find("span.genmed b")).append('<span onClick="selectCode(this)" class="selectCode">Sélectionner le contenu</span>');
        });

and add this to css

Code:
        .selectCode { float:right; text-transform: uppercase; cursor:pointer; }

and this to phpbb3
Code:
    function selectCode(a)
        {
          // Get ID of code block
          var e = a.parentNode.parentNode.getElementsByTagName('CODE')[0];
     
          // Not IE
          if (window.getSelection)
          {
              var s = window.getSelection();
              // Safari
              if (s.setBaseAndExtent)
              {
                s.setBaseAndExtent(e, 0, e, e.innerText.length - 1);
              }
              // Firefox and Opera
              else
              {
                // workaround for bug # 42885
                if (window.opera && e.innerHTML.substring(e.innerHTML.length - 4) == '<BR>')
                {
                    e.innerHTML = e.innerHTML + ' ';
                }
     
                var r = document.createRange();
                r.selectNodeContents(e);
                s.removeAllRanges();
                s.addRange(r);
              }
          }
          // Some older browsers
          else if (document.getSelection)
          {
              var s = document.getSelection();
              var r = document.createRange();
              r.selectNodeContents(e);
              s.removeAllRanges();
              s.addRange(r);
          }
          // IE
          else if (document.selection)
          {
              var r = document.body.createTextRange();
              r.moveToElementText(e);
              r.select();
          }
        }
        if(text){}else{ var text = 'Selecionar todos';}
        jQuery(document).ready(function(){
          jQuery("dl.codebox dt").not("dl.spoiler > dt").html('Code: <a href="#" onclick="selectCode(this); return false;" title="Select all the content" class="code-a"> Select Content </a>');
        });

Step 1:
Navigate to...
Administration Panel → Modules Tab → Javascript codes management → Create a new javascript

Step 2:
Call it whatever you like and set its placement to all pages.


not working for me

isnanz
Forumember

Male Posts : 206
Reputation : 0
Language : Indonesian
Location : Indonesia

http://help.forumotion.com

Back to top Go down

Solved Re: Select Content don't work on my forum

Post by isnanz on September 5th 2011, 6:10 pm

@Base wrote:Could it be that you have some other coding on your forum which could be conflicting this?

maybe but i understand with problem..

isnanz
Forumember

Male Posts : 206
Reputation : 0
Language : Indonesian
Location : Indonesia

http://help.forumotion.com

Back to top Go down

Solved Re: Select Content don't work on my forum

Post by Ahmedvirus on September 5th 2011, 6:12 pm

maybe but i understand with problem
Try the code on another forum ok !

Ahmedvirus
Forumember

Male Posts : 321
Reputation : 59
Language : English

http://help.forumotion.com

Back to top Go down

Solved Re: Select Content don't work on my forum

Post by Zack. on September 5th 2011, 6:23 pm

I created a new phpbb2 forum and both codes worked. The code for phpbb2 wasn't working because i modified viewtopic_body in a haotic way. Thanks rock

Zack.
Forumember

Male Posts : 26
Reputation : 6
Language : Romanian/English/French
Location : Sibu, Romania

http://global4um.net

Back to top Go down

Solved Re: Select Content don't work on my forum

Post by isnanz on September 5th 2011, 6:34 pm

working if i create Display -> Templates -> General -> overall_header / Top of the page<script type="text/javascript" src="http://limadua.forumotion.com/10195.js"></script>


http://limadua.forumotion.com/t684-test-code-and-select-content

isnanz
Forumember

Male Posts : 206
Reputation : 0
Language : Indonesian
Location : Indonesia

http://help.forumotion.com

Back to top Go down

Solved Re: Select Content don't work on my forum

Post by isnanz on September 5th 2011, 7:01 pm

solved this!

isnanz
Forumember

Male Posts : 206
Reputation : 0
Language : Indonesian
Location : Indonesia

http://help.forumotion.com

Back to top Go down

Solved Re: Select Content don't work on my forum

Post by Zack. on September 5th 2011, 7:07 pm

Glad to hear that, me too thumright

Zack.
Forumember

Male Posts : 26
Reputation : 6
Language : Romanian/English/French
Location : Sibu, Romania

http://global4um.net

Back to top Go down

Solved Re: Select Content don't work on my forum

Post by Base on September 5th 2011, 7:33 pm

isnanz, posting consecutively is not tolerated unless separated by 24 hours since the last post. This is your 2nd reminder about this, next time will be a warning. Wink

Solved => Locked and Archived

Base
Forumaster

Male Posts : 10386
Reputation : 1687
Language : English and French
Location : United Kingdom, England

http://forumotionhub.net

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum