[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
Meykota
Registered User
Posts: 30
Joined: Sat Aug 16, 2014 5:19 pm
Location: Leipzig, Germany

Re: [RC] Custom Code

Post by Meykota »

Right :D Thanks, I'll try this.
User avatar
hamidouki
Registered User
Posts: 344
Joined: Sun Aug 02, 2015 2:33 pm

Re: [RC] Custom Code

Post by hamidouki »

adding a logo + a banner well adjusted to custom code

hello

i use this costume code extension and i m using in it a headline banner for the forum and i have also other 4 banners for categories
well my problem is that my headline banner can't get adjusted which means it looks terrible
i want to make a new JPG or PNG logo in the headline banner [the banner should be well adjusted ]

there it is the code that im using :
overall_header_stylesheets_after.html (E)

Code: Select all

<style>
/** remove the logo and increase the height of the headerbar **/
.imageset.site_logo {
    background-image: none;
    padding-left: 0px;
    padding-top: 183px;
}

/** Logo par défaut **/
.headerbar {
   background-image: url("{ROOT_PATH}images/banner+logo.jpg");
}

/** Logo pour la catégorie 13 et ses forums **/
<!-- IF FORUM_ID eq 13 or FORUM_ID eq 14 or FORUM_ID eq 15 or FORUM_ID eq 16 or FORUM_ID eq 17 or FORUM_ID eq 18 or FORUM_ID eq 19 or FORUM_ID eq 20 or FORUM_ID eq 21 -->
.headerbar {
	background-image: url("{ROOT_PATH}images/wahran_maintenance.jpg");
}
<!-- ENDIF -->

/** Logo pour la catégorie 76 et ses forums **/
<!-- IF FORUM_ID eq 79 or FORUM_ID eq 80 or FORUM_ID eq 81 or FORUM_ID eq 114 -->
.headerbar {
	background-image: url("{ROOT_PATH}images/wahran_langue.jpg");
}
<!-- ENDIF -->

/** Logo pour la catégorie 38 et ses forums **/
<!-- IF FORUM_ID eq 38 or FORUM_ID eq 39 or FORUM_ID eq 40 or FORUM_ID eq 41 or FORUM_ID eq 42 or FORUM_ID eq 43 or FORUM_ID eq 44 or FORUM_ID eq 45 -->
.headerbar {
	background-image: url("{ROOT_PATH}images/wahran_recrutement.jpg");
}
<!-- ENDIF -->
NB : i didn't know where to post this topic
thank you in advance
Salutations à la communauté phpBB
User avatar
SalazarAG
Registered User
Posts: 677
Joined: Mon Mar 30, 2015 10:48 am

Re: [RC] Custom Code

Post by SalazarAG »

Hello Martt! I would like to congratulate you for the excellent extensions, all work fine. I follow you and I always try to use their extensions!

I have a question: When uninstalled the Custom Code extension, the modifications remain?

I'm not really load notion, but the extent causes slowness in?
I'm sorry for my English. Google Translator does a bad job. :D
User avatar
SalazarAG
Registered User
Posts: 677
Joined: Mon Mar 30, 2015 10:48 am

Re: [RC] Custom Code

Post by SalazarAG »

Edit
I'm sorry for my English. Google Translator does a bad job. :D
User avatar
optimusvault
Registered User
Posts: 109
Joined: Tue Jul 28, 2015 2:51 am
Name: Aaron

Re: [RC] Custom Code

Post by optimusvault »

I've created a new file called viewtopic_body_avatar_after.html

I have added in content into the file, purged the cache, but the content does not show up in the view topic.

Is there something else I am meant to do?
Cheers,
Aaron
User avatar
thunderchero
Registered User
Posts: 129
Joined: Sun Nov 03, 2013 10:16 pm

Re: [RC] Custom Code

Post by thunderchero »

here is the best post I have seen describing how to add events
viewtopic.php?f=456&t=2275361&start=150#p13893871

thunderchero
User avatar
optimusvault
Registered User
Posts: 109
Joined: Tue Jul 28, 2015 2:51 am
Name: Aaron

Re: [RC] Custom Code

Post by optimusvault »

Thanks, managed to see how it's done in the end :)
Rather use this than use the template files to add content to.
Cheers,
Aaron
User avatar
SalazarAG
Registered User
Posts: 677
Joined: Mon Mar 30, 2015 10:48 am

Re: [RC] Custom Code

Post by SalazarAG »

Can anyone help me create a customized it code?

My idea is: put a Welcome Table on the main page visible to users with your username, avatar, title and rank.

I made a demonstrative picture of what I want:

Image

Can you help me?
I'm sorry for my English. Google Translator does a bad job. :D
User avatar
GoBieN
Registered User
Posts: 546
Joined: Fri Mar 05, 2004 5:22 pm
Location: Belgium

Re: [RC] Custom Code

Post by GoBieN »

Something along the line of ...

overall_header_page_body_before.html

Code: Select all

<-- IF S_USER_LOGGED_IN -->
	<div id="welcome-box" class="post" style="background-color: #ffeeee;">
		<h2>Welcome {S_USERNAME},</h2>
		<div id="welcome-box-avatar"><img alt="" id="welcome-box-avatar-image" /></div>
	</div>
<!-- ENDIF -->
overall_footer_after.html

Code: Select all

<-- IF S_USER_LOGGED_IN -->
	<script>
		$(function() {
			var src = $('#username_logged_in').find('img').attr('src');
			$('#welcome-box-avatar-image').src = src;
		});
	</script>
<!-- ENDIF -->

Not tested, top of my head. You need to finetune if further.
User avatar
SalazarAG
Registered User
Posts: 677
Joined: Mon Mar 30, 2015 10:48 am

Re: [RC] Custom Code

Post by SalazarAG »

GoBieN wrote:Something along the line of ...

overall_header_page_body_before.html

Code: Select all

<-- IF S_USER_LOGGED_IN -->
	<div id="welcome-box" class="post" style="background-color: #ffeeee;">
		<h2>Welcome {S_USERNAME},</h2>
		<div id="welcome-box-avatar"><img alt="" id="welcome-box-avatar-image" /></div>
	</div>
<!-- ENDIF -->
overall_footer_after.html

Code: Select all

<-- IF S_USER_LOGGED_IN -->
	<script>
		$(function() {
			var src = $('#username_logged_in').find('img').attr('src');
			$('#welcome-box-avatar-image').src = src;
		});
	</script>
<!-- ENDIF -->

Not tested, top of my head. You need to finetune if further.
In part, it worked.

However, only the "Welcome, (USER)" message was visible.
I'm sorry for my English. Google Translator does a bad job. :D
User avatar
GoBieN
Registered User
Posts: 546
Joined: Fri Mar 05, 2004 5:22 pm
Location: Belgium

Re: [RC] Custom Code

Post by GoBieN »

You need to tweak the javascript then.
User avatar
Lumpy Burgertushie
Registered User
Posts: 69228
Joined: Mon May 02, 2005 3:11 am

Re: [RC] Custom Code

Post by Lumpy Burgertushie »

you don't need the script.

just use this:

Code: Select all

<!-- IF S_USER_LOGGED_IN -->
   <div id="welcome-box" class="post" style="background-color: #ffeeee;">
      <h2>Welcome {S_USERNAME},</h2>
      <div><!-- IF CURRENT_USER_AVATAR -->{CURRENT_USER_AVATAR} <!-- ENDIF --></div>

   </div>
you can't get the rank title and image without creating a extension because the code for it is not global.

you would need some php in the index.php file that calls the data from the database and then creates the template variable.


robert
Premium phpBB 3.3 Styles by PlanetStyles.net

I am pleased to announce that I have completed the first item on my bucket list. I have the bucket.
User avatar
GoBieN
Registered User
Posts: 546
Joined: Fri Mar 05, 2004 5:22 pm
Location: Belgium

Re: [RC] Custom Code

Post by GoBieN »

I was looking at the phpBB wiki for a list of global variables but I could not find one for the AVATAR image so I tought about copying the source from the user menu in the navbar. But this is ofcourse much better if the global variable exists and is usable in the template.
User avatar
Lumpy Burgertushie
Registered User
Posts: 69228
Joined: Mon May 02, 2005 3:11 am

Re: [RC] Custom Code

Post by Lumpy Burgertushie »

I found the variable list here:
https://wiki.phpbb.com/Global_Template_Variables

however, that avatar variable is not in there.

I copied it from either the viewtopic_body or memberlist_body file. ( I don't remember which right now ) and it worked.

however, as I said the rank variables are not global and therefore are not in that list either. from what I can tell, they would have to be setup in index.php or made global somewhere else etc.


robert
Premium phpBB 3.3 Styles by PlanetStyles.net

I am pleased to announce that I have completed the first item on my bucket list. I have the bucket.

Return to “Abandoned Extensions”