reading _config table

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
Ned Keller
Regular
Posts: 5
Joined: Fri Dec 23, 2005 4:13 pm

reading _config table

Post by Ned Keller »

I'm just starting to use s9y, and I'm feeling a bit overwhelmed by the many files that it uses. Where does s9y read the fields in the _config table into the variables that it uses later in the program? I'm specifically looking for where the blogTitle entry is read.
Way
Regular
Posts: 59
Joined: Mon Nov 07, 2005 12:39 am
Location: SA
Contact:

Post by Way »

s9y is fantastic weblog, you don't need to edit any files
after installation, you just login to admin area and edit every thing you need to edit

to reach admin area just go to this
www.xxx.com/s9y/serendipity_admin.php

login with the user and password you provide while installation
good luck
Ned Keller
Regular
Posts: 5
Joined: Fri Dec 23, 2005 4:13 pm

Post by Ned Keller »

What I'm really trying to do is get s9y to read another field that I've added to _config, blogDisclaimer, which I want to appear in the page header. I figured that if I can find out where the program reads blogTitle, then I'll know where to read my new field.

And on a more fundamental level, I'm also trying to learn how the program works.
Way
Regular
Posts: 59
Joined: Mon Nov 07, 2005 12:39 am
Location: SA
Contact:

Post by Way »

you may Do that directly to the template area
In file index.tpl
Ned Keller
Regular
Posts: 5
Joined: Fri Dec 23, 2005 4:13 pm

Post by Ned Keller »

I really want to keep ALL the content in the database. After poking around some more, I've figured it out (I think - it's working, at any rate).

Serendipity_config.inc.php calls the function serendipity_load_configuration(), which is in the file functions_config.inc.php. That function reads the fields from the _config table, and puts them into $serendipity['foo'] variables. Those variables then get assigned to smarty variable with function serendipity_smarty_init(), in functions_smarty.inc.php. Whew.

So, I added my new blogDisclaimer field to the _config table, created a config.inc.php file in my templates directory for code that mimics the serendipity_smarty_init() code, made a new formatting class in style.css, and stuck a new smarty call into index.tpl. Way more work than sticking some text into the right spot, but I've learned a lot about how Serendipity works, and it will be simple to add the next bit of text in a way that keeps content and presentation separate.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

I was on vacation, so sorry that I couldn't reply to your original intended question. :-)

However if you find more questions like these in the future, we can surely help you further :-)

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply