Montag, 20. September 2010

Format source code for blogging with www.blogger.com

http://formatmysourcecode.blogspot.com/

Nice JQuery login in Joomla

1. Remove original content of file /modules/mod_login/tmpl/default.php and add the following instead:
<?php // no direct access
defined('_JEXEC') or die('Restricted access'); ?>
<?php if($type == 'logout') : ?>
<form action="index.php" method="post" name="login" id="form-login">

    <div class="tab">
        <ul class="login">
            <li class="left">&nbsp;</li>
            <li>Hello <?php echo $user->get('name')?></li>
            <li class="sep">|</li>
            <li id="toggle">
                <input type="submit" name="Submit" class="bt_login" value="<?php echo JText::_( 'BUTTON_LOGOUT'); ?>" />            
            </li>
            <li class="right">&nbsp;</li>
        </ul> 
    </div> <!-- / top -->


    <input type="hidden" name="option" value="com_user" />
    <input type="hidden" name="task" value="logout" />
    <input type="hidden" name="return" value="<?php echo $return; ?>" />
</form>
<?php else : ?>
<?php if(JPluginHelper::isEnabled('authentication', 'openid')) :
        $lang->load( 'plg_authentication_openid', JPATH_ADMINISTRATOR );
        $langScript =     'var JLanguage = {};'.
                        ' JLanguage.WHAT_IS_OPENID = \''.JText::_( 'WHAT_IS_OPENID' ).'\';'.
                        ' JLanguage.LOGIN_WITH_OPENID = \''.JText::_( 'LOGIN_WITH_OPENID' ).'\';'.
                        ' JLanguage.NORMAL_LOGIN = \''.JText::_( 'NORMAL_LOGIN' ).'\';'.
                        ' var modlogin = 1;';
        $document = &JFactory::getDocument();
        $document->addScriptDeclaration( $langScript );
        JHTML::_('script', 'openid.js');
endif; ?>


<!-- Panel -->
<div id="toppanel">
  <div id="panel">
    <div class="content clearfix">
      <form action="<?php echo JRoute::_( 'index.php', true, $params->get('usesecure')); ?>" method="post" name="login" id="form-login" >
      <div class="loginContent">
        <div class="left">
          <?php echo $params->get('pretext'); ?>
          <fieldset class="input">
            <p id="form-login-username">
              <label for="modlgn_username"><?php echo JText::_('Username') ?></label><br />
              <input id="modlgn_username" type="text" name="username" class="inputbox field" alt="username" size="18" />
            </p>
            <p id="form-login-password">
              <label for="modlgn_passwd" class="grey"><?php echo JText::_('Password') ?></label><br />
              <input id="modlgn_passwd" type="password" name="passwd" class="inputbox field" size="18" alt="password" />
            </p>
          <?php if(JPluginHelper::isEnabled('system', 'remember')) : ?>
            <p id="form-login-remember">
              <label><input name="remember" id="modlgn_remember" type="checkbox" checked="checked" value="yes" alt="Remember Me"  /> &nbsp;<?php echo JText::_('Remember me') ?></label>
            </p>
          <?php endif; ?>
          <input type="submit" name="Submit" class="bt_login" value="Log In" />
          </fieldset>
        </div>
        <div class="left">
          <p>&nbsp;</p>
          <ul>
            <li>
              <a href="<?php echo JRoute::_( 'index.php?option=com_user&view=reset' ); ?>">
              <?php echo JText::_('FORGOT_YOUR_PASSWORD'); ?></a>
            </li>
            <li>
              <a href="<?php echo JRoute::_( 'index.php?option=com_user&view=remind' ); ?>">
              <?php echo JText::_('FORGOT_YOUR_USERNAME'); ?></a>
            </li>
            <?php
              $usersConfig = &JComponentHelper::getParams( 'com_users' );
              if ($usersConfig->get('allowUserRegistration')) : ?>
            <li>
              <a href="<?php echo JRoute::_( 'index.php?option=com_user&view=register' ); ?>">
                <?php echo JText::_('REGISTER'); ?></a>
            </li>
            <?php endif; ?>
          </ul>
        </div>
      </div>
    </div> <!-- /login -->
      
    <?php echo $params->get('posttext'); ?>

    <input type="hidden" name="option" value="com_user" />
    <input type="hidden" name="task" value="login" />
    <input type="hidden" name="return" value="<?php echo $return; ?>" />
    <?php echo JHTML::_( 'form.token' ); ?>
  </form>


</div>


<!-- The tab on top -->    
    <div class="tab">
        <ul class="login">
            <li class="left">&nbsp;</li>
            <li id="toggle">
                <a id="open" class="open" href="#">Log&nbsp;In&nbsp;|&nbsp;Register</a>
                <a id="close" style="display: none;" class="close" href="#">Close Panel</a>                
            </li>
            <li class="right">&nbsp;</li>
        </ul> 
    </div> <!-- / top -->
</div>
  
<?php endif; ?>


2. Create a new module in the Module Manager of Joomla:

3. Add the following lines in your html file:
<link rel="stylesheet" href="/joomlatest/templates/inusign_blog/css/login.css" type="text/css" />
 <!--Toggle effect (show/hide login form) -->
 <script src="http://code.jquery.com/jquery-1.4.2.min.js" type="text/javascript"></script>
 <script src="/joomla/templates/inusign_blog/js/slide.js" type="text/javascript"></script>

4. Upload slide.js

Samstag, 26. Juni 2010

JQuery Autocomplete:
deprecated: http://docs.jquery.com/Plugins/Autocomplete
new: http://jqueryui.com/demos/autocomplete/

More info:
http://wiki.jqueryui.com/Autocomplete
http://af-design.com/blog/2010/05/12/using-jquery-uis-autocomplete-to-populate-a-form/

Mittwoch, 9. September 2009

Youtube videos for vehicle tracking and positioning

http://www.youtube.com/watch?v=LxGiQ_ck44w
http://www.youtube.com/watch?v=KKTNQCCJpss

Convert text to HTML entities

Use the following website:
http://centricle.com/tools/html-entities/

Integration of tinCaptcha into ccnewsletter


  1. Download and install plg_tincaptcha_0.1.1.zip and com_tincaptcha_0.1.1.zip from http://joomlacode.org/gf/project/tincaptcha/frs/



  2. Download, unpack and install ccNewsletter_104Stable_UNZIP_FIRST.zip from http://extensions.chillcreations.com/


  3. Edit components/com_ccnewsletter/views/ccnewsletter/tmpl/default.php of your Joomla installation and add the following lines below the Email input field:

    <tr>
    <td width="150">
    <label for="captcha">
    <?php echo JText::_( 'TIN_CAPTCHA' );?>:
    </label>
    </td>
    <td>
    <img src="index.php?option=com_tincaptcha&task=captcha_display" onclick="this.src='index.php?option=com_tincaptcha&task=captcha_display&t='+(new Date()).getTime()" alt="Click to refresh image"/>
    <input type="text" name="captcha" id="captcha" size="10" value="" />
    </td>
    <td>

    </td>
    </tr>
    <tr>
    <td colspan="2">
    If code cannot be deciphered, click on the image to generate a new code <br/> &nbsp;
    </td>
    </tr>

    after the lines:

    <td>
    <input type="text" name="email" id="email1" size="32" maxlength="250" value="<?php echo $this->email;?>" />
    </td>
    </tr>



  4. Edit components/com_ccnewsletter/controller.php of your Joomla installation and add the following lines:

    $captchk = plgSystemTincaptcha::check(JRequest::getVar('captcha', '', 'post'));

    if ($captchk !== true)
    {
    // show info
    echo plgSystemTincaptcha::check(JRequest::getVar('captcha', '', 'post'));
    break;
    }

    after the line:

    $params = &JComponentHelper::getParams( 'com_ccnewsletter' );




  5. Check it out!

Freitag, 14. August 2009

Download OpenCycleMap Tiles

  • Download Geo-OSM-Tiles (see previous blog entry)
  • Call: perl downloadosmtiles.pl --lat=47.218:47.785 --lon=10.787:11.727 --zoom=1:15 --baseurl=http://a.andy.sandbox.cloudmade.com/tiles/cycle