[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!
Get Involved
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)
leschek
Registered User
Posts: 791
Joined: Tue Jul 18, 2006 12:49 pm
Contact:

Re: [ALPHA] Custom Code

Post by leschek »

After update I'm not able to include css again. Same problem as described here.
User avatar
martti
Registered User
Posts: 867
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: [ALPHA] Custom Code

Post by martti »

leschek wrote:After update I'm not able to include css again. Same problem as described here.
That's true. It's no longer the objective of the extension to create and serve directly css files. Only template files (.html) are going to be supported. However, you can still include inline styling between <style></style> tags or INCLUDECSS a css file from another directory from where files can be served directly.

I also going to remove the create and delete possibility of files, because everything can be written directly in the files provided. It also keeps the extension simple. I'm considering to add the possibility to add an alias or comment/description to files as you suggested.
User avatar
martti
Registered User
Posts: 867
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: [ALPHA] Custom Code

Post by martti »

leschek wrote:After update I'm not able to include css again. Same problem as described here.
I've updated the image-in-headerbar example in the second post of this topic with inline styling now.
leschek
Registered User
Posts: 791
Joined: Tue Jul 18, 2006 12:49 pm
Contact:

Re: [ALPHA] Custom Code

Post by leschek »

martti wrote:I also going to remove the create and delete possibility of files, because everything can be written directly in the files provided.
I liked to have option to create and edit files via ACP without going into FTP server. Also it was kind of more tidy to use different files for different addons.
martti wrote:I've updated the image-in-headerbar example in the second post of this topic with inline styling now.
Would be possible to add some template and css changes into board where more styles is installed? I mean for example I would like to change image of logo - on prosilver I would like to use the light logo and on other style dark logo.
User avatar
martti
Registered User
Posts: 867
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: [ALPHA] Custom Code

Post by martti »

leschek wrote: Would be possible to add some template and css changes into board where more styles is installed? I mean for example I would like to change image of logo - on prosilver I would like to use the light logo and on other style dark logo.
You can use a conditional statement with the variable T_TEMPLATE_NAME

In overall_header_stylesheets_after.html :

Code: Select all

<!-- IF T_TEMPLATE_NAME == 'prosilver' -->
<style>
/** Put here styling which is only applied to prosilver **/
</style>
<!-- ELSE -->
<style>
/** This styling is applied to whatever template is not prosilver. **/
</style>
<!-- ENDIF -->
User avatar
Walther
Registered User
Posts: 283
Joined: Fri Jul 09, 2004 5:21 pm
Location: The Netherlands

Re: [ALPHA] Custom Code

Post by Walther »

leschek wrote:martti wrote:
I also going to remove the create and delete possibility of files, because everything can be written directly in the files provided.
leschek wrote:I liked to have option to create and edit files via ACP without going into FTP server. Also it was kind of more tidy to use different files for different addons.
absolutely, it would be a pity if that possibility disappears. I have several .html files and if I want to change something it is much more easy and tidy to find the right file at once, instead of scrolling to the code in a little 8 row input field.

Please keep the possibility to create and delete files, it keeps coding so much more tidy ! :cry:
User avatar
martti
Registered User
Posts: 867
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: [ALPHA] Custom Code

Post by martti »

Walther wrote:Please keep the possibility to create and delete files, it keeps coding so much more tidy ! :cry:
Ok, democracy wins.
User avatar
Walther
Registered User
Posts: 283
Joined: Fri Jul 09, 2004 5:21 pm
Location: The Netherlands

Re: [ALPHA] Custom Code

Post by Walther »

martti wrote:Ok, democracy wins.
Yippieeee..... :)


I am not very good with Github, but made a pull request.

these are the pictures i forgot to include to show what changes, it gives more space on the screen to work with

Old situtation:
Image


New situtation:
Image
and after clicking +
Image
Last edited by Walther on Sat Nov 22, 2014 5:16 pm, edited 1 time in total.
leschek
Registered User
Posts: 791
Joined: Tue Jul 18, 2006 12:49 pm
Contact:

Re: [ALPHA] Custom Code

Post by leschek »

martti wrote:You can use a conditional statement with the variable T_TEMPLATE_NAME
Thank you.
Walther wrote:
martti wrote:Ok, democracy wins.
Yippieeee..... :)
+ 1
User avatar
alhitary
Registered User
Posts: 868
Joined: Wed Jan 17, 2007 7:51 am
Location: ROY
Name: Basil Taha Alhitary
Contact:

Re: [ALPHA] Custom Code

Post by alhitary »

Can I make changes in my style Prosilver by this Ext. ?

- Change Forum width
- Change Forum Background colour
- Add Forum background image
- Change the Logo.
- Change Header Height
- Change Header Colour
- Add Header Background
User avatar
Walther
Registered User
Posts: 283
Joined: Fri Jul 09, 2004 5:21 pm
Location: The Netherlands

Re: [ALPHA] Custom Code

Post by Walther »

alhitary wrote:Can I make changes in my style Prosilver by this Ext. ?
yes, see some postings above --> viewtopic.php?p=13821721#p13821721
lws96
Registered User
Posts: 100
Joined: Wed Aug 05, 2009 4:39 am

Re: [ALPHA] Custom Code

Post by lws96 »

Great extension. Can't wait until I try changing the headers. I Have a few questions though.

I downloaded the extension yesterday, and just to play around so I can have a visual where each of the included files modifications occur, I threw out dummy text.

I am not entirely sure where/how the "overall_header_head_append.html file gets modified. I would think it would be above "overall_header_content_before.html" like perhaps where the logo/board title/search box area be.

Also is it possible to include a sidebar either on the left or right side of the forums, that can also be hidden from guest users? I have a section on the current forum I"m looking to upgrade that should only be available to registered users.
User avatar
martti
Registered User
Posts: 867
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: [ALPHA] Custom Code

Post by martti »

lws96 wrote:I am not entirely sure where/how the "overall_header_head_append.html file gets modified. I would think it would be above "overall_header_content_before.html" like perhaps where the logo/board title/search box area be.
overal_header_head_append.html is inside the html <head></head> tags before the stylesheets. It can be used for metadata, or include stylesheets with INCLUDECSS. Because it's in the head and not in the body any code there doesn't give any direct visual output in your browser.

You can find the corresponding template event in overall_header.html:

Code: Select all

<!-- EVENT overall_header_head_append -->

{$STYLESHEETS}

<!-- EVENT overall_header_stylesheets_after -->

</head>
<body id="phpbb" class="nojs notouch section-{SCRIPT_NAME} {S_CONTENT_DIRECTION} {BODY_CLASS}">

<!-- EVENT overall_header_body_before -->

<div id="wrap">
	<a id="top" class="anchor" accesskey="t"></a>
	<div id="page-header">
		<div class="headerbar">
Iws96 wrote:Also is it possible to include a sidebar either on the left or right side of the forums, that can also be hidden from guest users? I have a section on the current forum I"m looking to upgrade that should only be available to registered users.
I would say it is certainly possible. If you need any additional template events to be included let it be known. The full list of template events in phpbb can be found here.
User avatar
martti
Registered User
Posts: 867
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: [ALPHA] Custom Code

Post by martti »

Updated to 0.2.0
Comments are now possible and shown in a files list.
I think soon it can go to RC. (It's not a complicated extension.)
To be done:
  • Include more tempate events.
  • Version check.
  • Update dutch translation.
User avatar
Walther
Registered User
Posts: 283
Joined: Fri Jul 09, 2004 5:21 pm
Location: The Netherlands

Re: [ALPHA] Custom Code

Post by Walther »

martti wrote:• Update dutch translation.
done, is ready to be merged on Github

edit:
uhoh...

Code: Select all

Fatal error: Uncaught exception 'Twig_Error_Loader' with message 'Unable to find template ".html" (looked into: ./../ext/marttiphpbb/customcode/adm/style, ./../adm/style).' in /home/ocr/domains/ohcrap.com/public_html/forum/vendor/twig/twig/lib/Twig/Loader/Filesystem.php:202 Stack trace: #0 /home/ocr/domains/ohcrap.com/public_html/forum/phpbb/template/twig/loader.php(106): Twig_Loader_Filesystem->findTemplate('.html') #1 /home/ocr/domains/ohcrap.com/public_html/forum/vendor/twig/twig/lib/Twig/Loader/Filesystem.php(138): phpbb\template\twig\loader->findTemplate('.html') #2 /home/ocr/domains/ohcrap.com/public_html/forum/vendor/twig/twig/lib/Twig/Environment.php(265): Twig_Loader_Filesystem->getCacheKey('.html') #3 /home/ocr/domains/ohcrap.com/public_html/forum/vendor/twig/twig/lib/Twig/Environment.php(312): Twig_Environment->getTemplateClass('.html', NULL) #4 /home/ocr/domains/ohcrap.com/public_html/forum/phpbb/template/twig/environment.php(151): Twig_Environment->l in /home/ocr/domains/ohcrap.com/public_html/forum/vendor/twig/twig/lib/Twig/Loader/Filesystem.php on line 202
And also, the language variable 'ACP_CUSTOMCODE_CREATE_DELETE' is absent


edit 2: btw, forgot to mention, phpBB version 3.1.2
Post Reply

Return to “Extensions in Development”