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.

JavaScript good for PHPBB 2 does not work with PHPBB 3

View previous topic View next topic Go down

JavaScript good for PHPBB 2 does not work with PHPBB 3

Post by HrvojeP on February 22nd 2015, 9:06 pm

Technical Details

Forum version : phpBB3
Position : Founder
Concerned browser(s) : Mozilla Firefox
Who the problem concerns : Yourself
When the problem appeared : When comparing forum versions PHPBB3 and PHPBB2
Forum link : http://drvenibrodovi.forumotion.eu/

Description of problem

I noticed that JavaScript working fine on PHPBB 2 does not work on PHPBB 3. What is the reason of this incompatibility?

The code in question is:
Code:
$(function(){
      $('.bodyline #page-body:has(#i_reply[alt*="zaključan"]), #main-content:has(.i_reply[alt*="zaključan"])').prepend('<div class="topic-warning-block" align="center">Tema je zaključana, ne može se više mjenjati.</div>');
    });

It is applied to denote locked topic. Word "zaključan" means "locked" in my native language.

There is CSS code with this JavaScript code:
Code:
/* Locked topic */
    .topic-warning-block {
      border: 1px solid;
      margin: 10px 0px;
      padding: 15px 10px 15px 50px;
      background-repeat: no-repeat;
      background-position: 10px center;
      background-image: url(http://1.bp.blogspot.com/_5rlxf3T9Z9U/SsIXuytpYfI/AAAAAAAADcI/I4Tm0W5gDQk/lock_32.png);
      color: #750000 !important;
      background-color: #D26067;
      -webkit-border-radius: 10px;
      -moz-border-radius: 10px;
      border-radius: 10px;
      text-align: center;
      font-weight: bold;
      font-size: 18px;
      text-shadow: 1px 1px 1px #AAA;
    }

Why is necessary to introduce this kind of incompatibility in so fraternal forum versions?


Last edited by HrvojeP on February 23rd 2015, 12:01 am; edited 1 time in total

HrvojeP
Forumember

Male Posts : 124
Reputation : 2
Language : Croatian, English
Location : Croatia

http://drvenibrodovi.forumotion.eu/

Back to top Go down

Re: JavaScript good for PHPBB 2 does not work with PHPBB 3

Post by _Twisted_Mods_ on February 22nd 2015, 10:01 pm

the issue is when you switch versions or theme's your css gets deleted .. you will need to re add your css for the warning message

_Twisted_Mods_
Helper
Helper

Male Posts : 2020
Reputation : 299
Language : English
Location : Ms

http://liquidcode.forumotion.com

Back to top Go down

Re: JavaScript good for PHPBB 2 does not work with PHPBB 3

Post by HrvojeP on February 22nd 2015, 10:10 pm

@_Twisted_Mods_ wrote:the issue is when you switch versions or theme's your css gets deleted .. you will need to re add your css for the warning message
I have, another, experimental forum where I test solutions. You are now on my "real" forum. I do not change version, skin or something else on "real" forum. I only add new JavaScript and CSS.

HrvojeP
Forumember

Male Posts : 124
Reputation : 2
Language : Croatian, English
Location : Croatia

http://drvenibrodovi.forumotion.eu/

Back to top Go down

Re: JavaScript good for PHPBB 2 does not work with PHPBB 3

Post by _Twisted_Mods_ on February 22nd 2015, 10:20 pm

oh then i will need your test forum and a login to see what the issue is there

_Twisted_Mods_
Helper
Helper

Male Posts : 2020
Reputation : 299
Language : English
Location : Ms

http://liquidcode.forumotion.com

Back to top Go down

Re: JavaScript good for PHPBB 2 does not work with PHPBB 3

Post by HrvojeP on February 22nd 2015, 10:24 pm

Actually this is my grand daughter's forum. Twisted Evil 

Test forum

Here is locked topic Locked

Account data are coming via PM.

P.S. On test forum everything works fine.

HrvojeP
Forumember

Male Posts : 124
Reputation : 2
Language : Croatian, English
Location : Croatia

http://drvenibrodovi.forumotion.eu/

Back to top Go down

Re: JavaScript good for PHPBB 2 does not work with PHPBB 3

Post by _Twisted_Mods_ on February 23rd 2015, 12:15 am

it works fine i see the message right on top .. try clearing your browser cache and history

_Twisted_Mods_
Helper
Helper

Male Posts : 2020
Reputation : 299
Language : English
Location : Ms

http://liquidcode.forumotion.com

Back to top Go down

Re: JavaScript good for PHPBB 2 does not work with PHPBB 3

Post by HrvojeP on February 23rd 2015, 2:09 am

On my forum (PHPBB 3) I see the message like this:


But I want the message like this one on PHPBB 2 forum (experimental forum):

I cleaned the browser cash and history. JavaScript and CSS code are the same.

HrvojeP
Forumember

Male Posts : 124
Reputation : 2
Language : Croatian, English
Location : Croatia

http://drvenibrodovi.forumotion.eu/

Back to top Go down

Re: JavaScript good for PHPBB 2 does not work with PHPBB 3

Post by _Twisted_Mods_ on February 23rd 2015, 2:47 am

make sure you have the css

_Twisted_Mods_
Helper
Helper

Male Posts : 2020
Reputation : 299
Language : English
Location : Ms

http://liquidcode.forumotion.com

Back to top Go down

Re: JavaScript good for PHPBB 2 does not work with PHPBB 3

Post by SLGray on February 23rd 2015, 5:01 am

phpBB 2 and 3 have different CSS selectors.  Make sure you are using phpBB 3 selectors.


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 35622
Reputation : 2372
Language : English
Location : United States

http://fmthemes.forumotion.com/

Back to top Go down

Re: JavaScript good for PHPBB 2 does not work with PHPBB 3

Post by HrvojeP on February 23rd 2015, 9:56 am

Thank you, Twisted_Mod and SLGray, for marking the direction where to look for errors. Give me some time to "investigate" what is going on in my CSS code. If I solve the problem, I will let you know.

Have a nice day! bye

Post scriptum 23.02.2015. 20:45: It must be some problem with CSS code implementation. It is the same as I did not write CSS code at all. Even the most simple instructions have not any influence on displayed message.

HrvojeP
Forumember

Male Posts : 124
Reputation : 2
Language : Croatian, English
Location : Croatia

http://drvenibrodovi.forumotion.eu/

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