11
sottwell
Re: Why sprintf?
  • 2004/7/3 13:28

  • sottwell

  • Just popping in

  • Posts: 30

  • Since: 2004/6/23


Just wanted to know if there was some reason why I should use it, if I don't want to. Thanks.



12
sottwell
Re: How to add avatars in bulk
  • 2004/7/3 9:18

  • sottwell

  • Just popping in

  • Posts: 30

  • Since: 2004/6/23


use phpmyadmin or some other MySQL administration tool. With phpmyadmin, select your database from the choices on the left (possibly only one database and it will already be selected), select the xoops_avatars table, then select the SQL tab. Use the file selection field and browse to the .sql file on your machine. This will set all the files to be in the uploads directory, so using your ftp client or whatever means you have of uploading files to your site, dump all the images into your uploads directory.

Keep in mind that the filename can only be 30 characters; if you've created an avatars directory that part of the path must be added to the filename in the database; you can do a "find/change all" of the .sql file in any text editor to add the avatars/ part to the filename, but it will make the filenames too long with this particular package. Oddly, it was exactly 4 characters too long, causing the .jpg to be truncated, and the avatars still worked on my local system (Apache/OS X) but failed on my remote hosted site (Apache/Linux).



13
sottwell
Re: Why sprintf?
  • 2004/7/3 3:37

  • sottwell

  • Just popping in

  • Posts: 30

  • Since: 2004/6/23





14
sottwell
Why sprintf?
  • 2004/7/2 22:06

  • sottwell

  • Just popping in

  • Posts: 30

  • Since: 2004/6/23


I have a question. Why do you use sprintf when defining the sql query?

$sql = sprintf("...



15
sottwell
Re: Module Needed to Create a Form to Accept User Inputted Data
  • 2004/7/2 19:06

  • sottwell

  • Just popping in

  • Posts: 30

  • Since: 2004/6/23


The message board sounds like a good idea, but if you still want to make a custom module I'll be glad to help. I'm working on a recipe exchange module, learning this system as I go, and all the practice I can get will be useful. I'm semi-retired, so I have plenty of time.



16
sottwell
Re: Display username and avatar in a block?
  • 2004/7/2 18:00

  • sottwell

  • Just popping in

  • Posts: 30

  • Since: 2004/6/23


I found something you might want to look at:

Who's Online Hack Site

Go to downloads/modules, and you'll find it listed as "exibegrupos.zip".

It's just a function that you copy into your code and call as needed. It's in Portugese/Brasilian, I believe, but the code itself is pretty clear, and should give you the general idea of what you want.



17
sottwell
Re: Display username and avatar in a block?
  • 2004/7/2 16:57

  • sottwell

  • Just popping in

  • Posts: 30

  • Since: 2004/6/23


I don't think you can just code in a block like that. It has to be a module, with blocks. You're not getting all of the system initialization including loading of globals like $xoopsUser. You can try including mainfile.php, that might do the trick.



18
sottwell
Re: Display username and avatar in a block?
  • 2004/7/2 15:01

  • sottwell

  • Just popping in

  • Posts: 30

  • Since: 2004/6/23


I do believe that you can get the user's avatar from the $xoopsUser object.

from the Xoops wiki

$xoopsUser->getVar('uname') - gets the username
$xoopsUser->getVar('uid') - gets the user id

I think you might be able to use:

$xoopsUser->getVar('user_avatar')

At least that's what it's called in the database.



19
sottwell
Re: Multiple languages
  • 2004/7/1 17:38

  • sottwell

  • Just popping in

  • Posts: 30

  • Since: 2004/6/23


Yes, I'm following the dev forums on sourceforge. I believe that they are considering using gettext.

It seems to me that is should be possible to add a field to the users table for language preference, and intercept calls to get() to query the users table for that field. I do have one concern, however, about the $xoopsConfig array. Is it cached somehow, or does it get loaded afresh for each user? Or can an individual element be updated and the whole thing refreshed? I mean when a user selects from the language menu on the home page. Handling the language at that level would be the easiest, rather than going through every function that sets the language and making modifications in where it gets the setting from!

I am thinking of cloning a new table for each language, with a prefix to match the language directories. That way you can just add the prefix variable to the query to get the material for that language, or from a default if the material does not exist or is empty in case of system messages.

I am putting together a community site that I hope will be quite busy, with forums, dating, a recipe exchange, photo gallery, job listings, all kinds of dynamic stuff, so the existing hack really won't work too well for me. I fiddled around with PHPNuke for a while, but I really just don't like it nearly as well as Xoops.






20
sottwell
Multiple languages
  • 2004/7/1 12:25

  • sottwell

  • Just popping in

  • Posts: 30

  • Since: 2004/6/23


I have tried the multilanguage hack and I really don't care for it. What occurred to me was that it should be possible to shift the "language" configuration option from the main system to the user, including adding a field in the users table, with a default of english. That way all you would need to do is make a translation of the files in the language directory, and make sure all text for output uses the defines. Does anybody else think this might work?




TopTop
« 1 (2) 3 »



Login

Who's Online

149 user(s) are online (75 user(s) are browsing Support Forums)


Members: 0


Guests: 149


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits