RSS
25 Apr 2012

If Statement for Joomla Templates

Author: admin | Filed under: Joomla, PHP
<?php $menu = JSite::getMenu();
  $arr = (array)$menu->getActive();
  $alias = $arr['title'];

  if ($alias == 'Contact Us') {
    echo('<div class="branchcol2">
          <jdoc:include type="message" />
          <jdoc:include type="component" />
        </div>');
  }

  else if ($alias == 'Kilrea Branch') {
    echo ('<div class="branchcol1">
      <h1>Contact Us</h1>
      <h2>Kilrea Branch</h2>
      <div class="text">
      <img src="/images/branch-details.png" />
      <p>Address: William Kerr & Co<br/>
      16 Church Street, Kilrea <br/>
      BT51 5QU</p>
      <p>Phone: 028 295 40263</p>
      <p>Fax: 028 295 40499</p>
      <p>Email: <a href="mailto:admin@kerrgroup.co.uk">admin@kerrgroup.co.uk</a></p>
      </div>
      </div><div class="branchcol1"><jdoc:include type="message" />
      <jdoc:include type="component" /></div>');
  }

  else {
    echo ('<div class="branchcol1">
      <h1>Contact Us</h1>
      <h2>Bushmills Branch</h2>
      <div class="text">
      <img src="/images/branch-details.png" />
      <p>Address: William Kerr & Co<br/>
      16 Church Street, Kilrea <br/>
      BT51 5QU</p>
      <p>Phone: 028 295 40263</p>
      <p>Fax: 028 295 40499</p>
      <p>Email: <a href="mailto:admin@kerrgroup.co.uk">admin@kerrgroup.co.uk</a></p>
      </div>
      </div><div class="branchcol1"><jdoc:include type="message" />
      <jdoc:include type="component" /></div>');
  }
?>
4 Apr 2012

IE 6 and 7 redirection image

Author: admin | Filed under: css, PHP

<?php

$ua $_SERVER['HTTP_USER_AGENT'];

if (strpos($ua,‘MSIE’) != false && strpos($ua,‘Opera’) === false)
{
if (
strpos($ua,‘Windows NT 5.2′) != false)
{
if(
strpos($ua,‘.NET CLR’) === false) return;
}
if (
substr($ua,strpos($ua,‘MSIE’)+5,1) < 7)
{
header(‘Location: http://redirect.com’);
}
}

?> 

12 Mar 2012

Virtualmart code to display currency symbol

Author: admin | Filed under: Joomla

Please use the code below to display prices in virtual mart

	<?php echo $this->currency->priceDisplay($product->product_price,'',false); ?>

this will display the properly formatted currency symbole
20 Dec 2011

when you get a permission denied on web config

Author: admin | Filed under: .net

goto to the httpdocs derectoy and add everyone under the security tab this is not a risk as .net applications handle authentication themselfs


 void Application_Error(object sender, EventArgs e)
        {
            StringBuilder sb = new StringBuilder();

            Exception objErr;

            objErr = Server.GetLastError().GetBaseException();

            Server.ClearError();

            if (objErr is ReflectionTypeLoadException)
            {

                ReflectionTypeLoadException reflerror = default(ReflectionTypeLoadException);

                reflerror = (ReflectionTypeLoadException)objErr;

                foreach (var ex in reflerror.LoaderExceptions)
                {

                    sb.AppendLine(ex.Message);

                }//foreach

            }

            sb.AppendLine("<b>Source:</b>" + Request.RawUrl);

            sb.AppendLine("<br><b>Browser:</b>" + Request.UserAgent);

            sb.AppendLine("<br><b>IP:</b>" + Request.UserHostAddress.ToString());

            sb.AppendLine("<br><b>UserID:</b>" + User.Identity.Name);

            sb.AppendLine("<hr><br><b>Error in: </b>" + Request.Url.ToString());

            sb.AppendLine("<br><b>Error Message: </b>" + objErr.Message.ToString());

            sb.AppendLine("<br><b>Stack Trace: </b><br>" + objErr.StackTrace.ToString());

            Response.Write(sb);

        }
}

			
11 Nov 2011

Simple jQuery Accordion Menu

Author: admin | Filed under: c#

Link: http://www.stemkoski.com/stupid-simple-jquery-accordion-menu/

11 Nov 2011

Dropdown box…

Author: admin | Filed under: html
  1. <select>
  2. <option selected>Option 1</option>
  3. <option>Option 2</option>
  4. <option>Option 3</option>
  5. </select>
10 Nov 2011

Horizontal li Navigation Menu

Author: admin | Filed under: css
#navlist li
{
	display: inline;
	list-style-type: none;
	float:left;
}
9 Nov 2011

Border-radius: create rounded corners with CSS!

Author: admin | Filed under: css

#example1 {
-moz-border-radius: 15px;
border-radius: 15px;
}

2 Nov 2011

Configuring .net server

Author: admin | Filed under: server configuration

How to Fix Login failed for user ‘IIS APPPOOL\ASP.NET v4.0′ error in IIS7

 

http://www.gotknowhow.com/articles/fix-login-failed-for-user-iis-apppool-aspnet-v4-error-iis7