[ABD] Custom Code

Any abandoned Extensions will be moved to this forum.

WARNING: Extensions in this forum are not currently being supported or maintained by the original Extension author. Proceed at your own risk.
Forum rules
IMPORTANT: Extension Development Forum rules

WARNING: Extensions in this forum are not currently being supported nor updated by the original Extension author. Proceed at your own risk.
User avatar
martti
Registered User
Posts: 913
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: [RC] Custom Code

Post by martti »

MarieNatalie wrote:Hello again

I had a problem described here viewtopic.php?p=14074096#p14074096
It's all about a bbcode, the HTML replacement is <a href="{URL}" rel="lytebox"><img style="width:320px; height:240;" src="{URL}" alt="" /></a>

Then I put the Javascript in your code in overall_footer_after.html (E) like this:

Code: Select all

<script type="text/javascript" src="lytebox.js"></script>
<link rel="stylesheet" href="lytebox.css"  media="screen" />
Is that right?

It seems be working but like my English :D
Which are the correct places in forums root lytebox.css and the images of lytebox must be placed

I always appreciate your support.
The answers in the topic you started are correct. Css in the head and js in the footer before the closing body tag. Maybe post the content of the lytebox.js in the topic you already started?
User avatar
martti
Registered User
Posts: 913
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: [RC] Custom Code

Post by martti »

thunderchero wrote:hi,

I know this has been covered before here, but it is not working correctly for me

I am wanting to add a icon legend before the stat block.
using the overall_footer_page_body_after.html I can create legend correctly, but it is below the stat blocks (not where I want it)

so I created "index_body_stat_blocks_before.html" and add code there. I thought this is a valid event, line 36 of index_body.html "<!-- EVENT index_body_stat_blocks_before -->"?

I have tried to add <!-- INCLUDE ../../../../../../store/customcode/index_body_stat_blocks_before.html --> to several of the files but never places it where I want.

what am I doing wrong?
Hello Thunderchero,

only a limited number of template events is supported by this extension. These are the ones that are indicated with (E) in the file list.
User avatar
umarizal
Registered User
Posts: 177
Joined: Mon Mar 17, 2008 2:03 am
Location: São Paulo - SP - Brasil
Name: Leandro dos Santos

Re: [RC] Custom Code

Post by umarizal »

Friends, how do I use this extension to insert a code on this location of viewtopic_body.html of Prosilver:
<div class="content"><!-- IF postrow.S_FIRST_ROW -->HERE<!-- ENDIF -->{postrow.MESSAGE}</div>
Thank you very much! ;)
EN: Do to others what you would want them to do to you.
ES: Haz a los demás todo lo que quieras que te hagan a ti.
PT: Faça aos outros o que você gostaria que fizessem a você.
User avatar
thunderchero
Registered User
Posts: 129
Joined: Sun Nov 03, 2013 10:16 pm

Re: [RC] Custom Code

Post by thunderchero »

martti wrote:only a limited number of template events is supported by this extension. These are the ones that are indicated with (E) in the file list.
OK, I understand now. is there any plans to add more events?

this is still my favorite extensions :D

thunderchero
User avatar
martti
Registered User
Posts: 913
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: [RC] Custom Code

Post by martti »

thunderchero wrote:
martti wrote:only a limited number of template events is supported by this extension. These are the ones that are indicated with (E) in the file list.
OK, I understand now. is there any plans to add more events?
No, not really. The extension is feature frozen at the moment.
User avatar
thunderchero
Registered User
Posts: 129
Joined: Sun Nov 03, 2013 10:16 pm

Re: [RC] Custom Code

Post by thunderchero »

I thought as much since it was in {RC] status.

would it be possible for you to explain how to add an event to your extension?

thunderchero
User avatar
martti
Registered User
Posts: 913
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: [RC] Custom Code

Post by martti »

thunderchero wrote:I thought as much since it was in {RC] status.

would it be possible for you to explain how to add an event to your extension?

thunderchero
viewtopic.php?f=456&t=2275361&start=150#p13893871
User avatar
thunderchero
Registered User
Posts: 129
Joined: Sun Nov 03, 2013 10:16 pm

Re: [RC] Custom Code

Post by thunderchero »

WOW, that was so easy.

worked on first attempt. those instructions should be at bottom of ACP file page, below "create file" box.

just wondering why you did not automate adding new events since it was so easy?
although I expect phpbb is why, core files should not be edited, extension files should not be edited by extension.

I have a lot to play with now... :D

thunderchero
User avatar
martti
Registered User
Posts: 913
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: [RC] Custom Code

Post by martti »

thunderchero wrote:WOW, that was so easy.

worked on first attempt. those instructions should be at bottom of ACP file page, below "create file" box.
It's modifying the extension. It's not an explanation on how to use it.
just wondering why you did not automate adding new events since it was so easy?
although I expect phpbb is why, core files should not be edited, extension files should not be edited by extension.
Indeed, the files are under version control. If a new version of the extension comes out and you update, you'll lose the changes you've made.
(Therefore it's better to fork the extension and maintain your own version and possibly pull changes from the original.)
User avatar
martti
Registered User
Posts: 913
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: [RC] Custom Code

Post by martti »

umarizal wrote:Friends, how do I use this extension to insert a code on this location of viewtopic_body.html of Prosilver:
<div class="content"><!-- IF postrow.S_FIRST_ROW -->HERE<!-- ENDIF -->{postrow.MESSAGE}</div>
Thank you very much! ;)
In case you need a posting template, then check out my other extension Posting Template.

If not, you can do it with some javascript:

Edit : overall_footer_after.html (E)

Code: Select all

<!-- prepend first post content in viewtopic -->

<!-- IF SCRIPT_NAME == 'viewtopic'  -->

<div style="display: none;" id="my-content">
    <h3 style="color:green;">My content here</h3>
</div>

<script>
$(document).ready( function() {
  window.setTimeout( function() {
    var myContent = $('#my-content');
    $('div.postbody:first div.content').prepend(myContent);
    myContent.css( "display", "inline" );  
  }, 100);
});
</script>

<!-- ENDIF -->
This will put the content on every page in the first post. If you need only the first post of the topic, then you can add an extra condition:
<!-- IF SCRIPT_NAME == 'viewtopic' -->
becomes
<!-- IF SCRIPT_NAME == 'viewtopic' and not CUSTOMCODE_PARAM_START -->

Image
User avatar
umarizal
Registered User
Posts: 177
Joined: Mon Mar 17, 2008 2:03 am
Location: São Paulo - SP - Brasil
Name: Leandro dos Santos

Re: [RC] Custom Code

Post by umarizal »

martti wrote:
umarizal wrote:Friends, how do I use this extension to insert a code on this location of viewtopic_body.html of Prosilver:
<div class="content"><!-- IF postrow.S_FIRST_ROW -->HERE<!-- ENDIF -->{postrow.MESSAGE}</div>
Thank you very much! ;)
In case you need a posting template, then check out my other extension Posting Template.

If not, you can do it with some javascript:

Edit : overall_footer_after.html (E)

Code: Select all

<!-- prepend first post content in viewtopic -->

<!-- IF SCRIPT_NAME == 'viewtopic'  -->

<div style="display: none;" id="my-content">
    <h3 style="color:green;">My content here</h3>
</div>

<script>
$(document).ready( function() {
  window.setTimeout( function() {
    var myContent = $('#my-content');
    $('div.postbody:first div.content').prepend(myContent);
    myContent.css( "display", "inline" );  
  }, 100);
});
</script>

<!-- ENDIF -->
This will put the content on every page in the first post. If you need only the first post of the topic, then you can add an extra condition:
<!-- IF SCRIPT_NAME == 'viewtopic' -->
becomes
<!-- IF SCRIPT_NAME == 'viewtopic' and not CUSTOMCODE_PARAM_START -->

Image
Our friend, thank you for the help! I will now test the night. I wanted something to appear beside the post content, you know?

Here's how it was in the phpBB 3.0.x using a Mod:
Image

The changes we propose will not be lost when performing update phpBB? There how to fashion as with standard positions of your extension, like as viewtopic_body_postrow_post_before.html or viewtopic_body_postrow_post_after.html? There is no way to create a viewtopic_body_postrow_beside_post.html or viewtopic_body_postrow_left_post.html for example?

Thank you very much for your help ;)
EN: Do to others what you would want them to do to you.
ES: Haz a los demás todo lo que quieras que te hagan a ti.
PT: Faça aos outros o que você gostaria que fizessem a você.
User avatar
martti
Registered User
Posts: 913
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: [RC] Custom Code

Post by martti »

umarizal wrote:
The changes we propose will not be lost when performing update phpBB?
You probably also want to add a float: left; to the styling of the inserted div. Then the text will wrap around the div.

Code: Select all

<div style="display: none; float: left;" id="my-content">
    <h3 style="color:green;">My content here</h3>
</div>
There how to fashion as with standard positions of your extension, like as viewtopic_body_postrow_post_before.html or viewtopic_body_postrow_post_after.html? There is no way to create a viewtopic_body_postrow_beside_post.html or viewtopic_body_postrow_left_post.html for example?

Thank you very much for your help ;)
The extension is in RC = feature frozen.
User avatar
umarizal
Registered User
Posts: 177
Joined: Mon Mar 17, 2008 2:03 am
Location: São Paulo - SP - Brasil
Name: Leandro dos Santos

Re: [RC] Custom Code

Post by umarizal »

Friend, you are best! It worked perfectly! Sorry, but thank you even! :D

Edited: you are best, not beast, sorry :oops:
Last edited by umarizal on Wed Nov 11, 2015 1:22 pm, edited 1 time in total.
EN: Do to others what you would want them to do to you.
ES: Haz a los demás todo lo que quieras que te hagan a ti.
PT: Faça aos outros o que você gostaria que fizessem a você.
User avatar
umarizal
Registered User
Posts: 177
Joined: Mon Mar 17, 2008 2:03 am
Location: São Paulo - SP - Brasil
Name: Leandro dos Santos

Re: [RC] Custom Code

Post by umarizal »

I'm trying to get my adsense code appears in all topics and posts of one or two forums, which do not want to appear. How do I?

I tried it here, to don´t display for forum id 27:
<!-- IF not U_MCP and not FORUM_ID == '27' -->
adsense code
<!-- ENDIF -->
But unfortunately, failed to display banners in all topics of all forums.

Where I went wrong? And if he did not view the code on the topics of more than a forum?

Thank you very much! ;)

---- Edited ----
Excuse my ignorance, I know very well programming, so I had to get information about operators in php.

I used the difference symbol <> and it worked. Thank you.

See:
<!-- IF not U_MCP and FORUM_ID <> 27 -->
adsense code
<!-- ENDIF -->
EN: Do to others what you would want them to do to you.
ES: Haz a los demás todo lo que quieras que te hagan a ti.
PT: Faça aos outros o que você gostaria que fizessem a você.
dunkane
Registered User
Posts: 19
Joined: Wed Jan 25, 2006 2:41 pm

[RC] Custom Code - adsense - no display

Post by dunkane »

in english :

Hello,

after installed custom code, i installed my adsense code, all was ok, ads were displayed,
and...since 3 days....no more display...i reinstalled the custom code..
i can see the place where the ad sense should be dislayed but nothing...i used another adsense code , that display somes ad on another part of the website...still nothing...

any idea ?
thank you

in french :
bonjour, après avoir installé custom code , j'ai installé mon code adsense, tout fonctionnait bien...affichage des pubs...
puis soudainement, plus aucun affichage de pub, adsense est bien configuré, j'ai meme repris un code qui fonctionne deja sur une autre partie du site hors forum...rien a faire...j'ai bien l'encadrement de la pub mais rien dedans...
j'ia raffraichis, effacé le cache...reinstallé le theme pro silver...rien a faire...

une idée ?

merci

Return to “Abandoned Extensions”