tips for phpbb3 modders

Discussion of general topics related to the new version and its place in the world. Don't discuss new features, report bugs, ask for support, et cetera. Don't use this to spam for other boards or attack those boards!
Forum rules
Discussion of general topics related to the new release and its place in the world. Don't discuss new features, report bugs, ask for support, et cetera. Don't use this to spam for other boards or attack those boards!
jimmygoon
Registered User
Posts: 75
Joined: Thu Jun 23, 2005 3:59 am

Re: tips for phpbb3 modders

Post by jimmygoon »

Handyman wrote: I've heard the hooks system mentioned before… but what does it do? does it make it possible to install a mod without modding files?


yes. its wonderful!
User avatar
EXreaction
Registered User
Posts: 1555
Joined: Sat Sep 10, 2005 2:15 am

Re: tips for phpbb3 modders

Post by EXreaction »

Handyman wrote: I've heard the hooks system mentioned before… but what does it do? does it make it possible to install a mod without modding files?


I would like to know as well. I would guess it is something like the permissions where you can simply upload a file and it will automatically be included and display what it needs. :)

I believe there is no need for code modification with a plugin/hooks system.
User avatar
EXreaction
Registered User
Posts: 1555
Joined: Sat Sep 10, 2005 2:15 am

Re: tips for phpbb3 modders

Post by EXreaction »

asinshesq
Registered User
Posts: 156
Joined: Fri May 14, 2004 10:32 pm
Location: NYC

Re: tips for phpbb3 modders

Post by asinshesq »

Can someone help me with how to add gifs to the imageset? I have a couple of gifs I want to include in a mod. They have text on them, so I did the following:

- placed the gifs in the styles/subSilver/imageset/en folder

- edited imageset.cfg to include the following two entreis:

Code: Select all

img_button_change_survey_answers = {LANG}/button_change_survey_answers.gif*25*164
img_button_fill_out_survey = {LANG}/button_fill_out_survey.gif*25*104
- went into the ACP style section, edited the imageset and added the two gifs as user defined images 1 and 2 (and they seem to show up fine there)

- tried to call them in a template by assigning a variable in the template as $user->img('button_fill_out_survey', 'FILL_OUT_SURVEY');

That didn't work at all. I even tried wiping out all files under the cache folder but that didn't help either. Any idea what I am doing wrong?
Alan
jimmygoon
Registered User
Posts: 75
Joined: Thu Jun 23, 2005 3:59 am

Re: tips for phpbb3 modders

Post by jimmygoon »

For example. with Drupal, when the page loads that lists the permissions for user levels it checks to see if {module}_permission{} exists in each {module}.module files and process it in its little way and loads it in... No editting required, it just recognizes and loads certain hooks. It allows for the creation of mod(ule)s without touching any core files and without complex instructions and most importantly without patching every single theme.
User avatar
Handyman
Registered User
Posts: 522
Joined: Thu Feb 03, 2005 5:09 am
Location: Where no man has gone before!
Contact:

Re: tips for phpbb3 modders

Post by Handyman »

jimmygoon wrote: For example. with Drupal, when the page loads that lists the permissions for user levels it checks to see if {module}_permission{} exists in each {module}.module files and process it in its little way and loads it in... No editting required, it just recognizes and loads certain hooks. It allows for the creation of mod(ule)s without touching any core files and without complex instructions and most importantly without patching every single theme.

Wow! cool!

I think phpBB3 tried to do that to some degree, but I'm not sure if it functions yet… but for the most part, I don't see how you could get around making code additions here and there… though it is possible to keep the code out of the core for the most part… and coding like that is very desirable.
My phpBB3 Mods || My Mod Queue
Search Engine Friendly (SEO) URLs || Profile link on Avatar and/or Username || AJAX Chat
Display Posts Anywhere || CashMod || AJAX Quick Edit || AJAX Quick Reply

Image
jimmygoon
Registered User
Posts: 75
Joined: Thu Jun 23, 2005 3:59 am

Re: tips for phpbb3 modders

Post by jimmygoon »

Handyman wrote:
jimmygoon wrote: For example. with Drupal, when the page loads that lists the permissions for user levels it checks to see if {module}_permission{} exists in each {module}.module files and process it in its little way and loads it in... No editting required, it just recognizes and loads certain hooks. It allows for the creation of mod(ule)s without touching any core files and without complex instructions and most importantly without patching every single theme.

Wow! cool!

I think phpBB3 tried to do that to some degree, but I'm not sure if it functions yet… but for the most part, I don't see how you could get around making code additions here and there… though it is possible to keep the code out of the core for the most part… and coding like that is very desirable.


My dream would be a something completely modular like Drupal with a REALLY powerful control panel to allow you to one-click-install - it would load the module file and save it for you (if chmod was right) from the phpbb approved "repository" -- think about it... It would be like package management in Linux - it could autoupdate!!! If only I had infinite time on my hands... I would build such a system... oh well...
User avatar
poyntesm
Registered User
Posts: 176
Joined: Fri May 13, 2005 4:08 pm
Location: Dublin, Ireland
Contact:

Re: tips for phpbb3 modders

Post by poyntesm »

Alan,

if you want custom images define your own is my recommendation.

SQL required...
ALTER TABLE phpbb_styles_imageset ADD `your_image` text NOT NULL;
UPDATE phpbb_styles_imageset SET your_image = '{LANG}/your_image.gif*x*x'

Then

Code: Select all

# 
#-----[ OPEN ]----- 
# 
includes/acp/acp_styles.php

#
#-----[ FIND ]------------------------------------------
#
			'polls'		=> array(
				'poll_left', 'poll_center', 'poll_right',
			),

#
#-----[ AFTER, ADD ]------------------------------------------
#
			'your_cat'	=> array(
				'your_image'
			),

#
#-----[ OPEN ]----- 
# 
styles/subSilver/imageset/imageset.cfg

#
#-----[ FIND ]------------------------------------------
#
img_button_topic_reply = {LANG}/button_topic_reply.gif*27*97

#
#-----[ AFTER, ADD ]------------------------------------------
#
img_your_image	= {LANG}/your_image*x*x

# 
#-----[ OPEN ]----- 
# 
language/en/acp/styles.php

#
#-----[ FIND ]------------------------------------------
#
	'IMG_CAT_USER'			=> 'Additional images',

#
#-----[ AFTER, ADD ]------------------------------------------
#

	'IMG_CAT_YOUR_CAT'    => 'Your category',
	'IMG_YOUR_IMAGE'	=> 'your image',
Then upload the image to correct location and refresh the imageset..
asinshesq
Registered User
Posts: 156
Joined: Fri May 14, 2004 10:32 pm
Location: NYC

Re: tips for phpbb3 modders

Post by asinshesq »

poyntesm wrote: Alan,

if you want custom images define your own is my recommendation.

SQL required...
ALTER TABLE phpbb_styles_imageset ADD `your_image` text NOT NULL;
UPDATE phpbb_styles_imageset SET your_image = '{LANG}/your_image.gif*x*x'

Then

Code: Select all

# 
#-----[ OPEN ]----- 
# 
includes/acp/acp_styles.php

#
#-----[ FIND ]------------------------------------------
#
			'polls'		=> array(
				'poll_left', 'poll_center', 'poll_right',
			),

#
#-----[ AFTER, ADD ]------------------------------------------
#
			'your_cat'	=> array(
				'your_image'
			),

#
#-----[ OPEN ]----- 
# 
styles/subSilver/imageset/imageset.cfg

#
#-----[ FIND ]------------------------------------------
#
img_button_topic_reply = {LANG}/button_topic_reply.gif*27*97

#
#-----[ AFTER, ADD ]------------------------------------------
#
img_your_image	= {LANG}/your_image*x*x

# 
#-----[ OPEN ]----- 
# 
language/en/acp/styles.php

#
#-----[ FIND ]------------------------------------------
#
	'IMG_CAT_USER'			=> 'Additional images',

#
#-----[ AFTER, ADD ]------------------------------------------
#

	'IMG_CAT_YOUR_CAT'    => 'Your category',
	'IMG_YOUR_IMAGE'	=> 'your image',
Then upload the image to correct location and refresh the imageset..

Thanks! But back to your observation about how people will actually install this, that's a lot of room for error. How would you use the user defined icons (which you can add to the database via the acp)?
Alan
User avatar
poyntesm
Registered User
Posts: 176
Joined: Fri May 13, 2005 4:08 pm
Location: Dublin, Ireland
Contact:

Re: tips for phpbb3 modders

Post by poyntesm »

To me user defined images are for styles and not MODs.

What would happen if your could is written to use user image 1 but the admin has to install it to user image 2 as 1 is already taken. They would need to change your code...so best to create your own.
Post Reply