Calcetines Extreme

Calcetines Extreme
Take care of you using the best socks

Sunday, October 14, 2012

joomla-Reset an administrator password

Problem:     i can't acces with admin password

Solution:

1. Use a MySQL utility such as phpMyAdmin or MySQL Query Browser .
2. Open the correct database and select the table, jos_users . (Change default table prefix, 'jos_' to your table prefix if it is different.)
3. Select the record (or table row) for your administrator account (The first admin account, created by default, has an id of 62).
4. Copy and paste a known MD5 hash, such as one of the samples provided with this FAQ, into the password field. Warning: You must paste the password's hash value, not the password itself. You can use any of the following password = hash pairs, or create your own using one of the tools listed below.
password = "MD5 hash of password"
------------------------------------------------------
admin = 21232f297a57a5a743894a0e4a801fc3
secret = 5ebe2294ecd0e0f08eab7690d2a6ee69
OU812 = 7441de5382cf4fecbaa9a8c538e76783
5. Save the record.
6. Point your browser to your site and log as the administrator using your new password.
7. Once logged in, Joomla will convert your md5 hash to a salted md5 hash, but you should change the password again to one that only you know.

Friday, September 21, 2012

Installing Magento without Mcrypt


problem
Can't install magento as mcrypt is not enabled on php server, that happend on most of shared hosting

Solution:

Step One: edit /app/code/core/Mage/Install/Installer/Env.php, and find

                Mage::getSingleton('install/session')->addError(
                    Mage::helper('install')->__('PHP Extension "%s" must be loaded', $extension)
                );
just above it, add

                if ($extension == 'mcrypt') {
                    return true;   
                }
Step Two: create /lib/Varien/Crypt/Base64.php and throw this into it

<?php

class Varien_Crypt_Base64 extends Varien_Crypt_Abstract {
    public function __construct(array $data=array()) {
        parent::__construct($data);
    }

    public function init($key) {
         return $this;
    }

    public function encrypt($data) {
        if (!strlen($data)) {
            return $data;
        }
        
        return base64_encode($data);
    }
    
    public function decrypt($data) {
        if (!strlen($data)) {
            return $data;
        } 

        return  base64_decode($data);
    }
}
Last Step: edit /lib/Varien/Crypt.php and change

    static public function factory($method='mcrypt')

with

    static public function factory($method='base64')

just done.

Saturday, September 15, 2012

Update K2 to send mail notifications on new comments

Problem:

Really it's not a problem, is a new requirement to allow Joomla K2 component to send notifications when a new comment has been published on frontpage; i still don't understand how that functionality has not been implementd on standar release of K2.

Solution:

we need to edit the code that allow to save new comments, you can find that on components/com_k2/models/item.php once.

1.- edit item.php and search for function comment()

2.- search string "...K2_COMMENT_ADDED_AND_WAITING_FOR_APPROVAL..."

3.- before that line add the next code:


$mainframe = &JFactory::getApplication(); $mail = &JFactory::getMailer(); $senderEmail = $mainframe->getCfg('mailfrom'); $senderName = $mainframe->getCfg('fromname'); $mail->setSender(array($senderEmail, $senderName)); $mail->setSubject(JText::_('K2_COMMENT_REPORT')); $mail->IsHTML(true); $body = " <strong>".JText::_('K2_NAME')."</strong>: ".$name." <br/> <strong>".JText::_('K2_REPORT_REASON')."</strong>: ".$reportReason." <br/> <strong>".JText::_('K2_COMMENT')."</strong>: ".nl2br($row->commentText)." <br/> "; $mail->setBody($body); $mail->ClearAddresses(); $mail->AddAddress($params->get('commentsReportRecipient', $mainframe->getCfg('mailfrom'))); $mail->Send();

Saturday, August 25, 2012

osCommerce Password Reset Using phpMyAdmin


Problem:
Sometimes you need to get in there and reset the password for oscommerce using phpMyAdmin.
In these instances, you do not just paste in a new password but you have to properly encode it first.
Here is a really handy tool to create a password hash for you, ready to be pasted into phpMyAdmin

Solution:
for the admin side, you will need to edit the admin table and paste this into the password field for the account you need to set the password for.

Check out this easy oscommerce password generator



Friday, August 24, 2012

How To Make A Custom Twitter Feed For Your Website


Problem:


Twitter has become very popular and has turned into a tool that a lot of websites have used to connect with their customers and promote themselves.  A great, and now popular, way to show those who visit your website that you have an active Twitter account is to add a Twitter feed to it.  In this post I will show you how to add a custom Twitter feed to your website, providing you with code and styling tips (don’t worry… it is actually very easy).

Solution:

1.- Styling The CSS

        #twitter_t      
                {
  width: 445px;
  height: 34px;
  background-image:url("your top image");
}
#twitter_m {
  width: 415px;
  padding: 0 15px;
  background:url("your middle image")  0 0 repeat-y;
}
  #twitter_container {
      min-height:45px;
      height:auto !important;
      height:40px;
      padding-bottom:10px;
  }

      #twitter_update_list {
          width: 415px;
          padding: 0;
          overflow: hidden;
          font-family: Georgia;
          font-size: 14px;
          font-style: italic;
          color: #31353d;
          line-height: 16px;
          font-weight:bold;
      }
      #twitter_update_list li {
          width: 415px;
          list-style: none;
      }
      #twitter_update_list li a {
          color: #5f6d76;
          border-bottom: dotted 1px;
          text-decoration: none;
      }
      #twitter_update_list li a:hover {
          color: #31353d;
          background: #d3f1f9;
      }
#twitter_b {
  width: 445px;
  height: 29px;
  background-image:url("your bottom image");
}
2.- Inserting JavaScript

<script src="http://twitter.com/javascripts/blogger.js" type="text/javascript"></script>
<script src="http://twitter.com/statuses/user_timeline/REPLACE.json?callback=twitterCallback2&count=1" type="text/javascript"></script>


In the code above, swap the word “REPLACE” with your account name. An example would be if your account name was “twitter.com/ChrisKirkman,” you would just place “ChrisKirkman” in there instead of the word “REPLACE.” If you do decide to display multiple tweets, instead of the one that I suggested, then all you will have to do is change where it says “count=1” to whatever number of tweets you would like to display.  Where it links to “blogger.js,” you can have your own file on your server that you link to that has the same information with some minor tweaks, if you like.

3.-  Insert the HTML on your website


<div id="twitter_t"></div>
<div id="twitter_m">
<div id="twitter_container">
<ul id="twitter_update_list"></ul>
</div>
</div>
<div id="twitter_b">


4.- just done









Monday, August 20, 2012

Creating custom Joomla Access Level


Problem:
Someone need allow to display individual items to a new customer authorization profiles not standard, the goal is to allow different customer to get access to a selected content exclusive for each customer, like have a friend at [1d34m0d4#@.

Solution:

1.- create 2 joomla "Acces level"
   - custo 1, custo 2, custo 3
   - each acces level have flaged: "manager", "author", "custo x"
      (where x is the item selected)
2.- define "access groups"
  - create 3 new groups with parent item "registed"
  - "G.custo 1", "G.custo 2" and "G.custo 3"
3.- create 3 users
  - "Custo 1" with group "G.custo1"
  - "Custo 2" with group "G.custo2"
  - "Custo 3" with group "G.custo3"

just done, now to enable content to a especifi ""custo" you have to
select level acces "G.custo1" to selected item/s.

Wednesday, July 25, 2012

add a own style sheet to a template



Problem:

We need to add a own style sheet to our template to avoid make changes on exiting template style sheet, the change is to avoid lose that change when we update or change the template.

Solution:
Create your own stylesheet.css file and upload to your styles folder, a good place is a new folder outside joomla default structure.

Search for template folder httpdocs/templates/<yourdefaulttemplate>/index.php; you can edit that file using extplorer joomla extensión or directly from joomla template editor.

after <head tag> insert that piece of code:

// Add a reference to a CSS file
JHTML::stylesheet($filename, $path);

$filename: will be the name of your own style sheet like "mystyle.css"
$path: that is the complete path to the filename selected before, like: "..\..\customcode\mystyle.css"

Another solution for a lit of templates in joomla than use gantry framework to use the addstyle method.

<? php $gantry->addStyles(array(' mystyle .css')); ?>

Thats is a sample where you can see how to add the new sheet on a gantry:

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $gantry->language; ?>" lang="<?php echo $gantry->language;?>" >
<head>
<?php
$gantry->displayHead();
$gantry->addStyles(array('template.css','joomla.css'));
$gantry->addStyles(array(' mystyle .css'));
...

Source links:

setup joomla directory permissions chmod

Problem:

One of the best features of joomla is the quick installation process that allow to install the cms online in just only 5 min; but after the installation there is a little issue that give me a rudimentary work to do always.

That dammed work is to change directory permissions on all joomla directory on administrator->system info->Directory permissions; around 28 directories on joomla 1.5.

Solution:

I have created a ftp batch file that change the directory permissions on all joomla 1.5 directories, that batch make the joomla installation more quick.

1.- create a txt file name <myftpbatch>.txt
2.- insert that code on file:

open www.yoursite.com
<user>
<pwd>
cd httpdocs
quote site chmod 0777 administrator/cache
quote site chmod 0777 administrator/backups
quote site chmod 0777 administrator/components
quote site chmod 0777 administrator/language
quote site chmod 0777 administrator/language/en-GB
quote site chmod 0777 administrator/modules
quote site chmod 0777 administrator/templates
quote site chmod 0777 components
quote site chmod 0777 images/
quote site chmod 0777 images/banners
quote site chmod 0777 images/stories
quote site chmod 0777 language
quote site chmod 0777 language/en-GB
quote site chmod 0777 language/pdf_fonts
quote site chmod 0777 media
quote site chmod 0777 modules
quote site chmod 0777 plugins
quote site chmod 0777 plugins/content
quote site chmod 0777 plugins/editors
quote site chmod 0777 plugins/editors-xtd
quote site chmod 0777 plugins/search
quote site chmod 0777 plugins/system
quote site chmod 0777 plugins/user
quote site chmod 0777 plugins/xmlrpc
quote site chmod 0777 templates/
quote site chmod 0777 cache
quote site chmod 0777 new/administrator/cache
quote site chmod 0777 logs
quote site chmod 0777 tmp
quote site chmod 0777 dir
bye
3.- run de following command trough a command window on your local computer:
ftp -s:<myftpbatch>.txt

just done, on only 3 steps now you will have all joomla directories writeable.
that have been tested on Joomla 1.5 installation, when i need it on another joomla version i will update the post.



Source links: