[3.3][BETA] Custom Code

A place for Extension Authors to post and receive feedback on Extensions still in development. No Extensions within this forum should be used within a live environment!
Ideas Centre
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: Extensions Development rules

IMPORTANT FOR NEEDED EVENTS!!!
If you need an event for your extension please read this for the steps to follow to request the event(s)
User avatar
martti
Registered User
Posts: 870
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: [RC] Custom Code

Post by martti »

Jsanta wrote:Any plans to create code insert to right after post input box?
I mean under buttons "save draft", "preview" and "submit"? That would be great for adsense.
The extension is feature frozen at the moment. No new events are planned. You could put Adsense on top of the posting page by using overall_header_content_before.html
To show your content only in the posting page, use the SCRIPT_NAME template variable.

Edit :: overall_header_content_before.html

Code: Select all

<!-- IF SCRIPT_NAME == 'posting' -->
Your content ...
<-- ENDIF --> 
Second question: how to put code under specific categories? Let's say the second and fourth category for example?
I presume you talk about:
To insert Google Adsense code in between the categories on the index page:

Edit :: forumlist_body_category_header_before.html

Code: Select all

<!-- Google Adsense -->
<!-- IF forumrow.S_IS_CAT and not forumrow.S_FIRST_ROW -->
   <div class="post adsense">
      Your Google adsense code here...
   </div>
<!-- ENDIF -->
Image
To show your content only under specific categories, you can use the row numbers. These row numbers depend on your board. You can find which row numbers you need by displaying them:

Edit :: forumlist_body_category_header_before.html

Code: Select all

{forumrow.S_ROW_COUNT}
For example, you need row numbers 8 and 15 :

Edit :: forumlist_body_category_header_before.html

Code: Select all

<!-- Google Adsense -->
<!-- IF forumrow.S_ROW_COUNT == 8 or forumrow.S_ROW_COUNT == 15 -->
   <div class="post adsense">
      Your Google adsense code here...
   </div>
<!-- ENDIF -->
Note that when you add / delete a forum afterwards on a preceding position, you need to edit the row numbers accordingly.
Jsanta
Registered User
Posts: 12
Joined: Mon Mar 30, 2015 7:55 pm

Re: [RC] Custom Code

Post by Jsanta »

Thanks a lot for help again, I will try those codes! :) :geek:
KnownSyntax
Registered User
Posts: 38
Joined: Mon Sep 22, 2014 8:47 pm
Location: Arizona, United States

Re: [RC] Custom Code

Post by KnownSyntax »

Wow this is amazing! I can't wait to use this on my own board since it will be a lifesaver with all of the codes I need to place in various locations.
maggador
Registered User
Posts: 22
Joined: Thu Apr 23, 2015 5:51 pm

Re: [RC] Custom Code

Post by maggador »

Hello and thanks for cool extension!

I am wondering if you or anyone ielse can help me out with a feature I would like in my forum? Perhaps you could even include it in your extension?

I want people to be able to post an image link, and have it automatically embed into the post where they put the image link just as when using the Img BBCode button.

But when doing so, I want the images to be uploaded to my own server and hosted there, instead of being externally hosted.

This way they will be sure to remain, because i have experienced problems with images disappearing before when embedded and hosted externally, which can make a mess in a post with many images important for certain things, and it ruins the post and makes it unuseable without its proper context that the images provides.

Perhaps its possible to modify the code of the already existing Img BBCode so it does the saving on own server part, which would be very good, but the ultimate would be both automatic embedding when an image link is posted and auto-uploaded and linked to on my own server, without even having to use the bbcode function.

I have your cool extension for media that auto-embeds media from more than 100 sites such as youtube etc by only posting the direct link to the media, but it doesnt embed direct image links, nor does it store any of the posted media on my own server - not that I want videos and stuff saved on my own server, I only want this function as described for image links..

Thanks to anyone that can help out with this.
User avatar
alhitary
Registered User
Posts: 868
Joined: Wed Jan 17, 2007 7:51 am
Location: ROY
Name: Basil Taha Alhitary
Contact:

Re: [RC] Custom Code

Post by alhitary »

I want to add google ads inside the topic ( 1st post only ).
How plz ?
Your cooperation is highly appreciated
User avatar
martti
Registered User
Posts: 870
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: [RC] Custom Code

Post by martti »

alhitary wrote:I want to add google ads inside the topic ( 1st post only ).
How plz ?
Your cooperation is highly appreciated
It is explained in the second post of this topic.
User avatar
martti
Registered User
Posts: 870
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: [RC] Custom Code

Post by martti »

maggador wrote:Hello and thanks for cool extension!

I am wondering if you or anyone ielse can help me out with a feature I would like in my forum? Perhaps you could even include it in your extension?

I want people to be able to post an image link, and have it automatically embed into the post where they put the image link just as when using the Img BBCode button.

But when doing so, I want the images to be uploaded to my own server and hosted there, instead of being externally hosted.

This way they will be sure to remain, because i have experienced problems with images disappearing before when embedded and hosted externally, which can make a mess in a post with many images important for certain things, and it ruins the post and makes it unuseable without its proper context that the images provides.

Perhaps its possible to modify the code of the already existing Img BBCode so it does the saving on own server part, which would be very good, but the ultimate would be both automatic embedding when an image link is posted and auto-uploaded and linked to on my own server, without even having to use the bbcode function.

I have your cool extension for media that auto-embeds media from more than 100 sites such as youtube etc by only posting the direct link to the media, but it doesnt embed direct image links, nor does it store any of the posted media on my own server - not that I want videos and stuff saved on my own server, I only want this function as described for image links..

Thanks to anyone that can help out with this.
Didn't you post in the wrong topic? It seems you talk about another extension. Anyway it is out of scope for this extension.
maggador
Registered User
Posts: 22
Joined: Thu Apr 23, 2015 5:51 pm

Re: [RC] Custom Code

Post by maggador »

Yes sorry, I was in fact meaning to post this in the forum for a different extension I got called s9e/mediaembed, my mistake.. Will look it up.. Though, is it not possible for you to make an "in post" part of your own extension where we can add any text or code at any specific place within a post?

In either case thanks for good extension, I use it with great success for different purposes so far :)
User avatar
martti
Registered User
Posts: 870
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: [RC] Custom Code

Post by martti »

maggador wrote:Though, is it not possible for you to make an "in post" part of your own extension where we can add any text or code at any specific place within a post?
Uhm, no, that's out of scope for this extension.
However, you can do a lot with Javascript. The specific place is defined by a string inside the post? To find text you could use the jquery contains selector: http://api.jquery.com/contains-selector/#text
MarieNatalie
Registered User
Posts: 46
Joined: Tue May 05, 2015 1:19 pm
Location: Athens Greece
Name: Maria

Re: [RC] Custom Code

Post by MarieNatalie »

Hi
Could someone please tell me where and what to do with that to change background color in prosilver 3.1.3

thanks in advance ;)
User avatar
martti
Registered User
Posts: 870
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: [RC] Custom Code

Post by martti »

MarieNatalie wrote:Hi
Could someone please tell me where and what to do with that to change background color in prosilver 3.1.3

thanks in advance ;)
ACP > Extensions > Custom Code > Edit :: overall_header_stylesheets_after.html (E)

Code: Select all

<!-- background color -->
<style>
body
{
    background-color: #ffe8c5;
}
</style>
Image
MarieNatalie
Registered User
Posts: 46
Joined: Tue May 05, 2015 1:19 pm
Location: Athens Greece
Name: Maria

Re: [RC] Custom Code

Post by MarieNatalie »

Thanks a lot martti :) Done!!

If I'm not asking too much dear, could you tell me how to add the my social icons (links) in the header right.
Should i use that first http://phpbb.hifikabin.me.uk/viewtopic.php?f=3&t=32 or not?
boardman
Registered User
Posts: 47
Joined: Wed May 06, 2015 10:08 pm

Re: [RC] Custom Code

Post by boardman »

Hm, is it correct that the extension won't work for including .php files? Thanks!
User avatar
martti
Registered User
Posts: 870
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: [RC] Custom Code

Post by martti »

boardman wrote:Hm, is it correct that the extension won't work for including .php files? Thanks!
No, it's not for php. Only template files are possible -> html.
User avatar
martti
Registered User
Posts: 870
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: [RC] Custom Code

Post by martti »

MarieNatalie wrote:Thanks a lot martti :) Done!!

If I'm not asking too much dear, could you tell me how to add the my social icons (links) in the header right.
Should i use that first http://phpbb.hifikabin.me.uk/viewtopic.php?f=3&t=32 or not?
There is no template event in this extension at that place, but you can do it with Javascript:

Edit : overall_footer_after.html (E)

Code: Select all

<!-- append social icons to breadcrumbs section -->

<li class="rightside responsive-hide" style="display: none;" id="my-social-icon">
    My icon here ...
</li>

<script>
$(document).ready( function() {
  window.setTimeout( function() {
    var mySocialIcon = $('#my-social-icon');
    $('#nav-breadcrumbs').append(mySocialIcon);
    mySocialIcon.css( "display", "inline" );  
  }, 100);
});
</script>
Image

The best is to put every icon in it's own <li> tag.
Last edited by martti on Sat Sep 05, 2015 10:49 am, edited 1 time in total.
Post Reply

Return to “Extensions in Development”