Pligg CMS Forums


Go Back   Pligg CMS Forum > Pligg Help > General Help



Suggestions and improvements in Pligg for developers and advanced users v.1.0


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-15-2007, 02:09 PM
AnAlienHolakres3's Avatar
Coder
 
Join Date: Jul 2007
Location: Prague
Posts: 119
Send a message via ICQ to AnAlienHolakres3
Lightbulb Suggestions and improvements in Pligg for developers and advanced users v.1.0

Hello everyone who is interested in Pligg improvement. I made list of customization, some of them should be good to implement into Pligg:
1) link editation button should not be the same as "preview before submitting" button, it should be different.
2) friends.php there are many non-translated things (such as "you have no friends etc")
Solution: Add more terms into lang.conf .

3)when user select login or register page there is absolutely no reason to have the same in sidebar
Solution:into login.php and register.php add smarty with specific value (true or 1) and in sidebar.tpl add one more condition to this variable. If user select login or registration page in main menu, sidebar box wont appear. To be specific:
login.php add this code before tpl files are loaded, so before //page section:
PHP Code:
//disable register and login in sidebar
    
$main_smarty->assign('disableLogReg',1);
 
//************************************** 
And the same into register.php add to this else:
PHP Code:
else {
    
// breadcrumbs and page title
    
$navwhere['text1'] = $main_smarty->get_config_vars('PLIGG_Visual_Breadcrumb_Register');
    
$navwhere['link1'] = getmyurl('register''');
    
$main_smarty->assign('navbar_where'$navwhere);
    
$main_smarty->assign('posttitle'" / " $main_smarty->get_config_vars('PLIGG_Visual_Breadcrumb_Register'));
    
    
//disable register and login in sidebar
    
$main_smarty->assign('disableLogReg',1);
    
//**************************************

Finally in sidebar.tpl add one more condition:
PHP Code:
{if $user_authenticated ne true} {if $disableLogReg neq 1}      
{
assign var=sidebar_module value="login"}{include file=$the_template_sidebar_modules."/wrapper2.tpl"
{/if}{/if} 

4)errors during registration: i dont know why every incorrect information should have its own header and description "registration not successfull":


This is result of my customization:

There is the modification:
1) register.tpl file: more simple:
PHP Code:
{config_load file="/libs/lang.conf"}

<
h2>{#PLIGG_Visual_Register_Do_Not_Continue#}</h2>

<fieldset><legend>{#PLIGG_Visual_Register_Errors#}</legend>
                                          
        
{$error_text}
         
    <
br/><br/>
    
    <
input type=button onclick="window.history.go(-1)" value="{#PLIGG_Visual_Register_Error_Return#}" class="submit" >
    
</
fieldset
2) register.php - replace original function verify_reg with this modification:
PHP Code:
//****************************************************************
// verify registration information
// modified to be more friendly by AnAlienHolakres3
//****************************************************************
function verify_reg($username$email$password$password2) {
    global 
$main_smarty$the_template;
                  
    
    if(!isset(
$username) || strlen($username) < 3) { // if no username was given or username is less than 3 characters
     
$error_text .=  "<div class='error'>".$main_smarty->get_config_vars("PLIGG_Visual_Register_Error_UserTooShort")."</div>";                                                    
                     
    }    
    if(!
preg_match('/^[a-zA-Z0-9\-\.@]+$/'$username)) { // if username contains invalid characters
     
$error_text .=  "<div class='error'>".$main_smarty->get_config_vars("PLIGG_Visual_Register_Error_UserInvalid")."</div>";  
                                                                  
    }
    if(
user_exists(trim($username)) ) { // if username already exists
     
$error_text .=  "<div class='error'>".$main_smarty->get_config_vars("PLIGG_Visual_Register_Error_UserExists")."</div>";                                                    
                                           
    }
    if(!
check_email(trim($email))) { // if email is not valid
    
$error_text .=  "<div class='error'>".$main_smarty->get_config_vars("PLIGG_Visual_Register_Error_BadEmail")."</div>";                                                    
                                          
    }
    if(
email_exists(trim($email)) ) { // if email already exists
    
$error_text .=  "<div class='error'>".$main_smarty->get_config_vars("PLIGG_Visual_Register_Error_EmailExists")."</div>";                                                    
                                         
    }
    if(
strlen($password) < ) { // if password is less than 5 characters
    
$error_text .=  "<div class='error'>".$main_smarty->get_config_vars("PLIGG_Visual_Register_Error_FiveCharPass")."</div>";                                                    
                                      
    }
    if(
$password !== $password2) { // if both passwords do not match
    
$error_text .=  "<div class='error'>".$main_smarty->get_config_vars("PLIGG_Visual_Register_Error_NoPassMatch")."</div>";                                                    
                                      
    }
    if (
$error_text) {
     
$error=true;    
     
$main_smarty->assign('error_text',$error_text);
     
$main_smarty->display($the_template '/register_error.tpl');
    
    }
    return 
$error;
    
}
//********************************************************************** 
3) little customization in main.css:
Code:
.error {color:#8c0000;font-weight:bold;margin-top:10px;border:1px solid #ff0000;background:#FFC5BE;padding:5px;width:100%;padding-left:3px;padding-right:3px}
4) no reason to have 2 same headers "unsuccessful registration", so the second one could be "errors" or something similar,into lang.conf add something like
Code:
//<SECTION>REGISTRACE</SECTION><ADDED>0.9x</ADDED>
PLIGG_Visual_Register_Errors = "errors:"
This works with customized code in register.tpl file.


OK thats all for this time. I hope somebody will be interested.

=Everything that has a beginnig has an end=
=Nevere stop fighting=

Site: http://www.vselink.cz
Reply With Quote
Sponsor
  #2 (permalink)  
Old 09-15-2007, 02:30 PM
Constant Pligger
 
Join Date: Apr 2007
Posts: 1,071
Are these error messages the standard ones? Sorry, I don´t understand Czech.
Reply With Quote
  #3 (permalink)  
Old 09-15-2007, 02:31 PM
AnAlienHolakres3's Avatar
Coder
 
Join Date: Jul 2007
Location: Prague
Posts: 119
Send a message via ICQ to AnAlienHolakres3
Thats right. It does not matter which language it is, it depends on your lang.conf file

=Everything that has a beginnig has an end=
=Nevere stop fighting=

Site: http://www.vselink.cz
Reply With Quote
  #4 (permalink)  
Old 09-15-2007, 02:35 PM
Constant Pligger
 
Join Date: Apr 2007
Posts: 1,071
I thought that and asked just to be sure :-)
Reply With Quote
Reply

Thread Tools
Display Modes



Pligg Modules and Pligg Templates from Pligg Pro Find support on the Pligg CMS Forum - 24 hours a day! Use the coupon code PLIGG at Dreamhost.com to receive a discount of up to $84.00 Make a donation to support Pligg CMS development