11
jordi_rc
How control panel appearance works. Need help to make a hack
  • 2006/11/29 22:34

  • jordi_rc

  • Not too shy to talk

  • Posts: 114

  • Since: 2006/8/21


Hello.

I am using XOOPS 2.0.15.

I find the admin control panel is a bit confusing, so I am trying to make a hack on it.
I need to know what I am doing. I will try to guess it, but if some experienced programmer in php or some XOOPS developer may help me to answer these questions I will not smash my brain so much.

If I can do something simple and good, I will post my work to the XOOPS community.

I would like to:

1) Add some image buttons to most used system functions in the control panel home. Like groups, users, modules... so they can be clicked directly and make it more friendly

2) Be able to modify the modules list. I find I need to admin some modules very often (like per example the forum) and some not so often (like liaise, per example).
It is a bit confussing to look for them in that long vertical list.

It seems that modules are displayed by install order. In addition they all have similar icons.

I know I could change the icons.I changed the modules icon that I don't use so often to grey, to be able to separate them visually from the others.

But what I would like to do is generate another page just with the icons, and name of module. And maybe add a parameter the way "Active" is -with checkbox- so the module is added to this page of "most used modules"

I don't know if I am explaining well my idea.

Do I need to add a parameter to the Database? In wich table?

What php file displays the list of modules? I could clone it to do this, and modify the display...

Thanks for any reply..


Jordi
"Battles are fought by those with the courage to believe. They are won by those who find the heart to share." -MANOWAR



12
jordi_rc
Re: Can't upload images :(
  • 2006/11/28 21:06

  • jordi_rc

  • Not too shy to talk

  • Posts: 114

  • Since: 2006/8/21


Hi

Try CHMOD -R 777 directory/

and also CHMOD 777 the files to upload if you use linux.

It worked for me.

Jordi
"Battles are fought by those with the courage to believe. They are won by those who find the heart to share." -MANOWAR



13
jordi_rc
Merge Xoops with Bytehoard
  • 2006/11/23 22:35

  • jordi_rc

  • Not too shy to talk

  • Posts: 114

  • Since: 2006/8/21


Hello!

In the site I am developing I needed a way for users to easilly upload files to their own folder in a visual way, in order to host their files. I needed a way so each user has his/her own folder created when they get promoted to a certain group and enters the file application for first time. The user cannot (and mustn't) reach other users folders.

I found the perfect GPL solution: it is called Bytehoard.
(http://www.bytehoard.org/)

This is the way to merge XOOPS with Bytehoard:

1) We suppose you have XOOPS installed, your website is called "myweb" and bytehoard is installed in a folder called "bytehoard" just inside your XOOPS root folder.

2) Create a custom group of users based in regular users.

3) Create a custom block in Xoops. Give the admin and the group created in point 1) access to this block, and not the others.

4) In the block, select as type of content PHP. Paste this code:
global $xoopsUser;

$uid=$xoopsUser->getVar('uid');

echo
"<a href='http://localhost/myweb/fileaccess.php?uid=$uid'>Build your website and files<br></a>";


5) Create a file in your XOOPS root folder called fileaccess.php with this code:

<?php

// include all needed files

include '../mainfile.php';
include_once 
XOOPS_ROOT_PATH.'/class/module.textsanitizer.php';

include_once 
XOOPS_ROOT_PATH .'/modules/system/constants.php';

include_once 
XOOPS_ROOT_PATH.'/bytehoard/config.inc.php';

$uid intval($_GET['uid']); 

// prevent empty uid

if ($uid <= 0) { 
    
redirect_header('../index.php'3'You are not allowed to enter here');
    exit();
}

// test if it is XOOPS user

if (is_object($xoopsUser)) { 

// test if he is of group 4 of xoops, or the admin, as they are the only with files access

$groups is_object($xoopsUser) ? $xoopsUser->getGroups() : array(XOOPS_GROUP_ANONYMOUS);
if ( 
in_array("4"$groups) || in_array("1"$groups) ) {

// test if he sends his own uid

if ($uid == $xoopsUser->getVar('uid')) { 

// extra test if uid is not empty

if (!empty($_GET['uid'])) { 

                        
// get XOOPS data of the user
                        
$uid $_GET['uid'];
        
                        
mysql_connect(XOOPS_DB_HOSTXOOPS_DB_USERXOOPS_DB_PASS) or die(mysql_error());
                        
mysql_select_db(XOOPS_DB_NAME) or die(mysql_error());
                        
$member mysql_fetch_assoc(mysql_query("SELECT uid, uname, pass, email, name FROM xoops_users WHERE uid=$uid"));

                        
$muname=$member[uname];
                        
$memail=$member[email];
                        
$mname=$member[name];
                        
$mpass=$member[pass];

                            
mysql_connect($dbconfig['host'], $dbconfig['username'], $dbconfig['password']) or die(mysql_error());
                            
mysql_select_db($dbconfig['db']) or die(mysql_error());
                            
$worldbuilderExiste mysql_fetch_assoc(mysql_query("SELECT * FROM bh2_users WHERE username='$muname'"));
                            
                            
// si el usuario ya existe lo manda al login. Si no, crea su cuenta.
                            
                            
if ($worldbuilderExiste) { 
                            
header 'Location: http://localhost/myweb/bytehoard/' ); exit; }
                            
                            else{ 
                                                
                            echo 
"<br><br>ahora eres worldbuilder";
                            
// creates bytehoard user
                        
$homedir "/".$muname;
                        
$quota round(30*1024*1024); // first number is the space in mb
            
mysql_connect($dbconfig['host'], $dbconfig['username'], $dbconfig['password']) or die(mysql_error());
            
mysql_select_db($dbconfig['db']) or die(mysql_error());
            
mysql_query("INSERT INTO bh2_users (username, password, type, homedir, quota) VALUES('$muname', '$mpass', 'normal', '$homedir', '$quota' )") or die(mysql_error());
            
mysql_query("INSERT INTO bh2_userinfo (username, itemname, itemcontent) VALUES('$muname', 'fullname', '$mname') ") or die(mysql_error());
            
mysql_query("INSERT INTO bh2_userinfo (username, itemname, itemcontent) VALUES('$muname', 'email', '$memail') ") or die(mysql_error());
                            
            
header 'Location: http://localhost/myweb/bytehoard/' ); exit; 
                            
            }
            } 
    else {    
redirect_header('../index.php'3'You are not allowed to enter this way'); exit(); }
    } 
    else {    
redirect_header('../index.php'3'You are not allowed to enter this way'); exit(); }
    } 
    else {    
redirect_header('../index.php'3'You must have file upload permission to enter here'); exit(); }
    } 
    else {    
redirect_header('../index.php'3'You are not allowed to enter this way'); exit(); }
?>


-------------

That's all. Now when the user gets promoted to the group with id 4 he gets access to the block, clics the link and the account is created in bytehoard. He logs in and can upload files to his folder.

---
Please tell me if I must add something for security reasons.

I think XOOPS and Bytehoard do a nice couple.


Jordi
"Battles are fought by those with the courage to believe. They are won by those who find the heart to share." -MANOWAR



14
jordi_rc
Re: Looking for blog... and domain name
  • 2006/11/23 22:12

  • jordi_rc

  • Not too shy to talk

  • Posts: 114

  • Since: 2006/8/21


Thanks for the link, I will check it.

Jordi

Note: snow77, YOU ROCK! Hammerfall are also great! I saw them when they came to Spain, in a concert, they play real good music.
They played with Primal Fear, also good music too. They said they became friends in the concert, and played a song together. They also complained a lot about the heat of the sun, because it was summer and had a sunlight right to the singer's face. Was a great concert!
"Battles are fought by those with the courage to believe. They are won by those who find the heart to share." -MANOWAR



15
jordi_rc
Re: Show the groups of the user in profile
  • 2006/11/23 22:08

  • jordi_rc

  • Not too shy to talk

  • Posts: 114

  • Since: 2006/8/21


If you like the hack it would be an honour to have it added to any section you like.

Feel free to add this text or make any adittions, or tell me how to post it and to where, or if I need to explain something more deeply.

Many people try to get the group shown in the profiles, so maybe it would be nice to add this to the XOOPS core in a better way, not so hard coded.

Thanks a lot again to both, Herve and Jensclas.

Jordi
"Battles are fought by those with the courage to believe. They are won by those who find the heart to share." -MANOWAR



16
jordi_rc
Re: Show the groups of the user in profile
  • 2006/11/22 22:23

  • jordi_rc

  • Not too shy to talk

  • Posts: 114

  • Since: 2006/8/21


That would be a great honor. Thanks Hervé.

Jordi
"Battles are fought by those with the courage to believe. They are won by those who find the heart to share." -MANOWAR



17
jordi_rc
Looking for blog... and domain name
  • 2006/11/22 21:59

  • jordi_rc

  • Not too shy to talk

  • Posts: 114

  • Since: 2006/8/21


Hello

I am thinking on starting a blog to tell people about open source projects and tell what I learned about xoops, xubuntu and others.

Do you know some free good blog service like blogger where one can have .zip files (wich are not allowed in blogger) ?

Also, I am building my server and community.

Soon I will have a good DSL connection and static IP.
I am building my site with XOOPS CMS and Xubuntu, both excelent.

So I suppose the next is to reserve my domain name.
I have these questions:

1) What must I do to get people visit my site in my home server when they write a domain name? I read about DNS, domain names, etc but I am a bit confused. Can someone explain me in a simple way what is all that? Do I need a domain name and contract something more?

2) Do you know some reliable website to contract those domain names or other services required, for not more than 10 euros a year?

3) I live in Spain, Europe. Do I need to contract a domain name here or can I contract it with an australian or US provider, per example?

4) Do you know some good website about networking in Xubuntu, or Ubuntu that explains things easy to beginners?

Thanks a lot.

Jordi
"Battles are fought by those with the courage to believe. They are won by those who find the heart to share." -MANOWAR



18
jordi_rc
Re: does anyone know any php programming tutorials?
  • 2006/11/22 21:35

  • jordi_rc

  • Not too shy to talk

  • Posts: 114

  • Since: 2006/8/21


cyberspace look this website:

http://www.tizag.com/

It has PHP and MySQL tutorials, very short explanations and all very understable.

I copied it to abiword, printed and after it I learned a lot of MySQL and PHP.

You also have another useful tutorials.

I didn't have any idea of PHP before and now I can hack many things.
As advice I recommend you start changing things in XOOPS or any other php code just NOW. Don't read too much, just learn by experience and seeing what changes do, or run small pieces of code. That is the best way to learn any programming.

So long,

Jordi-
"Battles are fought by those with the courage to believe. They are won by those who find the heart to share." -MANOWAR



19
jordi_rc
Re: how to make quotes
  • 2006/11/22 21:28

  • jordi_rc

  • Not too shy to talk

  • Posts: 114

  • Since: 2006/8/21


Thanks to all for the replys!

Quote:

So now this is a vulgar display of quote


And this is a code quote
Full of colour
,
[
color=0000FF]colour and color![/color]


Thanks, when I post code next time I will use code tags as it is easier for people to copy it.

Jordi
"Battles are fought by those with the courage to believe. They are won by those who find the heart to share." -MANOWAR



20
jordi_rc
Re: Show the groups of the user in profile
  • 2006/11/22 21:18

  • jordi_rc

  • Not too shy to talk

  • Posts: 114

  • Since: 2006/8/21


I am thinking in starting a blog about xubuntu XOOPS and other things that work well together and I am using.

Write an article here adding what?
Explaining the hack more deeply?

Jordi
"Battles are fought by those with the courage to believe. They are won by those who find the heart to share." -MANOWAR




TopTop
« 1 (2) 3 4 5 ... 10 »



Login

Who's Online

194 user(s) are online (136 user(s) are browsing Support Forums)


Members: 0


Guests: 194


more...

Donat-O-Meter

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

Latest GitHub Commits