Da FAQ

General issues

What are the differences between topics and sections?

Answer

Well, the topics tell you what the news is about. The sections allow you to move off-topic news out of the front page. For exemple, on Linuxfr.org, all news about cinema are put in a special section. Very seldomly does one of this news appear on the front page (only if it has a direct connexion with Linux). There is also a section to allow users to ask their questions: these news concern about any topic, but their type is inherently different from the standard, informative news. Thus they have been grouped in a section.

Hosting

Can daCode be installed on my.provider.com?

Answer

Most probably, yes. daCode is known to run with PHP 3 or 4, which is the case of most hosting providers. Some providers also have forbidden the use of the mail function. If you're in this case, see below.

My provider uses PHP4 and only allows for .php exentsions. How can I get daCode to run?

Answer

daCode can work with any extension. If you are running a Unix-like operationg system, just cd to the daCode directory and type


	      prompt$ perldoc scripts/dacodeconfig
	    
It will help you configuring daCode as you want, with the extension you want.

Ask on dacode-user@linuxfr.org list if you have a problem.

Warning (big one in red, with flashing lights): CVS will only work with original extensions, thus you'll have to switch back to .php3 before getting the last changes with CVS.

I don't have acces to the mysql client program. How can I create the database?

Answer

Simply use phpMyAdmin. Probably your provider has already set this up for you. See with him how to acces the database adminstration interface. Alternatively, you can download a copy (it' free software, too) and install it.

Once you are in the administration interface of phpMyAdmin, select your database, then "run queries on database". Choose the file sql/daCode.mysql and validate the form.

Can I use daCode on Free.fr (french-centric question:-) )?

Answer

Yes, it works... If you've got an account on Free.fr, we can assume you're french, so got read to french version. Maybe there are the same problems on non-french hosting providers... if so, please let us know.

There is a problem with the mail() function. Seems like it does not work.

Answer

Probably the mail() function has been disabled. Ask your provider to find out, and to find if a replacement is available. The BIG problem is that without a way to automatically send mails, users will never get their passwords, and thus will never be created at all...

If there is a replacement function, seach the calls to the mail function in the source and replace it with the specific function for your provider. Be careful: the number of arguments an their order may not be the same.

If there's no replacement available, or if you can just send a mail to yourself, there are some ugly turnarounds, described below.

First solution (by Matthieu Ros): if you have a way to send mails to yourself, use this to send the passwords to yourself... Of course you will know the passwords of all your users...

Second solution (by Guillaume Postaire): you print the password instead of sending it.

I get many "Maximum execution time exceeded" errors. What can I do?

Answer

Drop out any feature you don't really use. Also disable all functions in src/phplib/backends.php3. Just add "return;" at the begining of every function there. Once you are satisfied with the speed, you may reintroduce some features...

Can I run daCode on TuxFamily.org ?

Answer

TuxFamily.org is a SourceForge.net/Savannah-like service, which provides a web hosting service. daCode won't run on TuxFamily with PHP 3 and cache activated at the same time. If you want to use the cache (which is more than recommanded), activate PHP 4 in TuxFamily's panel, and convert daCode's files to .php or .php4 (see above in this FAQ for that).

Can I run daCode on MultiMania ?

Answer

Multimania is a french free hosting service, owned by Terra Lycos. It supports PHP 4 and MySQL. Like TuxFamily.org, it requires the .php extension, and doesn't support neither .php3, nor .php4. Again, see above to learn how to convert all .php3 extensions to .php.

Configuration

Is there a way to configure the location of the daCode files?

Answer

What you can do is to put phplib into htdocs/. Better put someting hard to guess (for the exemple sake, secret):


	      mv phplib htdocs/secret
	    
And then edit htdocs/daCode.php3 to change $libdir:
$libdir = $topdir . "./secret";
and this should work.

Various problems

I get an error "Cannot redefine class ..."
I use phplib. Can I use dacode with it?

Answer

This applies only if there's a auto_prepend statement in php.ini file. If you are using Apache, you can move the statement to .htaccess (that is a file that you put into your directories that are using phplib). To work properly, you need to check the directory tag/AllowOverride from httpd.conf to be sure that the file .htaccess is parsed. Exemple .htacces file for php4


	      <IfModule mod_php4.c>
	      #
	      # local settings for php in this domain
	      # include path is the path where PHP looks for
	      # required and included files
	      #
	      #php_value include_path
	      ".:/home/httpd/lib/externs/phplib/php/:/home/httpd/lib/php/internal/"
	      php_value auto_prepend_file
	      /home/httpd/lib/externs/phplib/php/prepend.php3
	      </IfModule>
	    

I can only get empty pages. What happened?

Answer

This comes probably from the database, which is ignored by PHP. Just look at the file php.ini or php3.ini to see if the database extensions are loaded.

If the extension is not loaded, you'll have to modify the config file, and restart the web server.

Another way to see if the extension is loaded is to create a small file containing only


	      <?php phpinfo(); ?>
	    
and to call this file throug a web server. If there is support for a database, there should be a paragraph about it.

I cannot connect to MySQL as root. Still I'm pretty sure of the root password.

Answer

The root password for MySQL is different from the unix root password. By default, the MySQL root password is empty. You may want to specify one with


	      mysqladmin -u root password new_password
	    

I always have the following error message: "Fatal error: Call to a member function on a non-object in /export/home/share/dacode/daCode-1.2.0/src/phplib/html.php3(50) : eval()'d code on line 1"

Answer

This error occurs when you haven't a database on your server or when daCode can't reach it. Verify that you already have a mySQL or PostgreSQL database running on your server, and that you put the good informations related to your database in your config file.

I just installed daCode, how can I get my admin password?

Answer

You must set your email address instead in the SQL database instead of the default admin email address (which is "root", by the way). You can also set it in the dacode.mysql file BEFORE creating the tables.

Then click on "Forgot your Password ?" and enter "admin" as login. Submit the form, and you will receive by email your new admin password.

Customization

How can I change the site's look?

Answer

You'll have to create your own template. The best way to learn how to do that is to read the doc about it.

You'll find it in the templates-en.html file, in the same directory as this FAQ.

How can I suppress some elements on the homepage?

Answer

The best way to suppress boxes from the homepage is to edit your config file, and to remove those boxes from the array called


	      $this->default_user_boxes
	    
Then remove them from this other array too

	      $this->user_boxes
	    
And you'll never see those boxes again.

How to change the logo and its subtitle ?

Answer

To change the logo, create your own logo (always in the PNG format) and place it into the directory of your theme. If you are using one of the themes given with daCode, place your logo into the directory of this theme.

Then edit your config file and change the var $this->logo with the name of your logo (without the .png extension). If your logo is called "logo", you don't have to change anything.

If you're using more than one theme, but made only one logo, and if you want to see it on all your themes, place it into htdocs/images/.

To edit the subtitle of the logo, just edit $this->aboutlogo in your config file, with what you want to read below your logo.

Note that you can also change the logo used in the PDA version. Place your (mini) logo into htdocs/images/, and edit the var $this->minilogo in the config file, with the name of this tiny logo (without its png extension, as usual). And if your logo is called "minilogo", no change is needed.

How to have a tiny icon beside the URI of my site ?

Answer

At first, remember that this is not especially daCode related. Now, create your image in a 16x16 format, with 256 colors max. Save it as "favicon.ico" (this MUST be the name of the file), and upload it to the root of your website.

Browsers that have this feature (Mozilla 0.9.6, Konqueror, MSIE, etc) will display your file beside (usually at the left) your URI.

Using daCode

I changed te admin password in the database, and I cannot log in anymore.

Answer

The passwords are crypted. You cannot change it directly in the database. If the admin email in the table "users" has a valid email field, just use "I forgot my password" on the front page. A new one will be mailed to you.

How can I put news in the Archive box?

Answer

The news end up automatically in the archive box. daCode considers the first 10 are displayed on the front page (or section page) and the next 10 go in the archive box.