1
DrSane
Re: Removing Links From Left Navigation Column
  • 2007/9/28 20:23

  • DrSane

  • Just popping in

  • Posts: 9

  • Since: 2007/8/8 1


Perfect. I just commented out the lines and it seems to work great. Thanks. :)



2
DrSane
Removing Links From Left Navigation Column
  • 2007/9/28 19:48

  • DrSane

  • Just popping in

  • Posts: 9

  • Since: 2007/8/8 1


I have a sub-link of "Articles" called "Archives" in the left navigation column that I want to remove. How do I go about doing this? I want to remove only the sub-link (Archives), not the main link (Articles).

Thanks in advance,
- Aaron



3
DrSane
Re: Hacking Extra DB Column
  • 2007/8/9 8:39

  • DrSane

  • Just popping in

  • Posts: 9

  • Since: 2007/8/8 1


That really wasn't at all what I was worried and or talking about. >_>

Regardless!

To anyone who happens to search for this thread, I found an answer! It was very simple. For example, if I wanted to add a new field for every user called "user_level", I would do the following:

mysql_query('ALTER TABLE xoops_users ADD user_level INT;');
return 
mysql_error();


I shoved that into some arbitrary core function that's accessed on a common page. Accessed the page. And then took the code out again.

Then I placed this snippet inside the "XoopsUser" function in "kernel/user.php".

$this->initVar('user_level'XOBJ_DTYPE_INTDEFAULT_LEVELfalse);


Instant extra column. What I was worried about was that this may create malformed MySQL queries for the insertion of new rows, but that is not the case.

Then the variable can be instantly accessed through "getVar('user_level')", without any additional preparation. It just defaults to DEFAULT_LEVEL. Surprisingly, no harm was done to the rest of the table.



4
DrSane
Re: Hacking Extra DB Column
  • 2007/8/8 23:44

  • DrSane

  • Just popping in

  • Posts: 9

  • Since: 2007/8/8 1


Okay, I've decided it's too risky to add columns to the MySQL database.

I will just store the additional columns in text files, and handle them through methods in kernel/user.php.



5
DrSane
Re: Hacking Extra DB Column
  • 2007/8/8 20:35

  • DrSane

  • Just popping in

  • Posts: 9

  • Since: 2007/8/8 1


Well, my profile example was just some random example I threw out there. Although it may be connected to how the user profile works, all I need to be able to do is add an extra field to the $thisUser / $xoopsUser object.

I guess I'll do some reading around the object.php code. Maybe I will find something there.

Edit:

I think I found it. "kernel/user.php".

It looks to me like I have to update the "insert" function and the "XoopsUser" function to handle the extra fields.

But as easy as this sounds, I think it's pretty dangerous. I don't want to try it. MySQL databases can't just suddenly gain an extra column, right? They have to be installed a certain way?

Any suggestions?



6
DrSane
Hacking Extra DB Column
  • 2007/8/8 18:58

  • DrSane

  • Just popping in

  • Posts: 9

  • Since: 2007/8/8 1


I'm currently extending the xoop script to allow additional information to be stored for each user.

For example, I could have a "Profile Views" column for each user, that keeps track of how many times the profile has been viewed.

Initially, I was going to use a separate database all together for the additional data. But is there already support? I tried scanning the docs, but can not find anything.

Can someone give me a point in the right direction?



7
DrSane
Re: How To Change/Update A Template After Installation?
  • 2007/8/8 17:49

  • DrSane

  • Just popping in

  • Posts: 9

  • Since: 2007/8/8 1


The first method worked perfectly! Thank you very much! :)



8
DrSane
How To Change/Update A Template After Installation?
  • 2007/8/8 12:59

  • DrSane

  • Just popping in

  • Posts: 9

  • Since: 2007/8/8 1


I want to update the userinfo.php template, but any changes I make to modules/system/templates/system_userinfo.html are not made effective, since the templates were placed into the MySQL database upon installation.

Is there a standard way of making changes to these templates? I could spend a couple hours reading lots of code until I can write the appropriate MySQL commands to update it manually. It would be nice if there is a faster way to get around this problem which seems should be common. Any snippet already in existence?

Thank-you in advance.




TopTop



Login

Who's Online

216 user(s) are online (119 user(s) are browsing Support Forums)


Members: 0


Guests: 216


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