This page has moved. You will be automatically redirected to its new location in 10 seconds. If you aren't forwarded to the new page, click here.

Search This Blog

Tuesday, April 13, 2010

Joomla puts meta tags

Joomla automatically puts meta tag generator with comments about joomla in the site. here is how to remove tht

http://forum.joomla.org/viewtopic.php?f=428&p=1214236

Thursday, April 1, 2010

Count number of modules in a joomla position

 <?php if (mosCountModules('left')>0) {  ?>


(where left is the position name)


http://forum.mamboserver.com/showthread.php?t=41728

Wednesday, March 31, 2010

Set title of Joomla page

$mydoc =& JFactory::getDocument();
$mytitle = $mydoc->getTitle();
$conf =& JFactory::getConfig();
$sitename = $conf->getValue('config.sitename');
$mydoc->setTitle($mytitle.' - '.$sitename);

 

http://joomlapanel.com/joomla-article/58-page-titles-in-joomla-15.html

Wednesday, March 3, 2010

Get latitude and longitude from Google maps

Open the map using post code or whtever u want to use.

then paste this in ur browser location bar:

javascript:void(prompt('',gApplication.getMap().getCenter()));



 



http://lifehacker.com/267361/how-to-find-latitude-and-longitude

Tuesday, February 23, 2010

Get Machine Name using .NET

System.Net.Dns.GetHostName();

Thursday, February 18, 2010

Assign file permissions in jumpbox

These files were not modified through Core FTP Lite or any other ftp client i was using, so I had to login to the jumpbox as root and pass the chmod command to change permissions

sudo –i

(logs you in temporarily as root)

chmod og=rw /var/data/joomla15/xyz/abc.php

http://www.jumpbox.com/archives/140_how-to-access-a-jumpbox-as-root.html

http://catcode.com/teachmod/chmod_cmd2.html

Wednesday, February 17, 2010

The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID {61738644-F196-11D0-9953-00C04FD919C1} to the user SID (S-1-5-21-573225893-205518295-0000000000-00000). This security permission can be modified using the Component Services administrative tool.

  • Search the GUID in HKCR registry..
  • 61738644-F196-11D0-9953-00C04FD919C1
  • The service name for this key is IIS WAMREG Admin Service
  • Load DCOMCNFG, browse to My Computer -> ” DCOM Config”
  • Go to the properties of IIS WAMREG
  • The permission missing was “Local Activation” permissions for the user .

 

http://www.cleverworkarounds.com/2007/10/25/dcom-fun-with-sharepoint/

Tuesday, February 16, 2010

Friday, February 12, 2010

Install IONCube on Joomla Jumpbox

I spent 3-4 hours in setting up IONCube on my joomla jumpbox but there were a lot  of access issues :S

Finally here is the set of steps that lead me to its installation:

  • download the ioncube loader from here:
    http://www.stevekallestad.com/wiki/IonCube_Installation
  • Extract the files and copy the files to storage/joomla15/ioncube/
  • Open your browser and browse to the ioncube-loader-helper.php file
  • Check to see whats the status of loader file currently on your jumpbox
  • We will be using php.ini setup to install the loader. php.ini is located in etc/php5/apache2/ folder.
    • Open your jumpbox and click on Alt+F1 to go to the console
    • type: sudo nano /etc/php5/apache2/php.ini
    • now add another entry in this file:
      zend_extension = /var/data/joomla15/ioncube/ioncube_loader_lin_5.2.so
    • Save this file and restart the apache server:
      sudo /etc/int.d/apache2 restart
  • Now browse again to the ioncube-loader-helper.php. it should show the following screen:

ion

Tuesday, February 2, 2010

The server tag is not well formed

Use single quotes instead of double :)

http://blogs.clearscreen.com/ragc/archive/2004/10/28/525.aspx

Remove an XML Node from XMLDocument

Instead of:

configDoc.RemoveChild(projectNodes[i]);

Use:

nodeName.ParentNode.RemoveChild(nodeName);

http://stackoverflow.com/questions/20611/removing-nodes-from-an-xmldocument

Monday, January 25, 2010

Create a SharePoint workflow history entry

public void CreateWorkflowHistoryEntry(string Outcome, string Description, string OtherData)

{ SPWorkflow.CreateHistoryEvent(workflowProperties.Web, workflowProperties.WorkflowId, (int)SPWorkflowHistoryEventType.WorkflowComment, this.workflowProperties.OriginatorUser, new TimeSpan(1), Outcome, Description, OtherData);

}

http://www.sharepointbuzz.com/archive/2009/01/21/how-to-create-a-sharepoint-workflow-history-event.aspx

Tuesday, January 19, 2010

Joomlapack and Kickstart

http://joomlapack.net/
http://joomlapack.net/download/itemlist/category/52-kickstart.html

Disable using Alias in the menu links

joomla

Set all the above options to NO

Joomla articles not updating

I was adding a new div in joomla articles but whenever i saved or applied the changes, all my changes reverted back and the div was lost from even the html source of the article. I spent almost 3 hours searching n trying different stuff.

The problem was that joomla articles dont allow empty divs

so:

<div class=”abc”></div>

would never show up neither be saved in the code

so i changed it to

<div class=”abc”>&nbsp;</div>

Enable remote access on Joomla Jumpbox Database

We have to enable remote access on a joomla jumpbox db in order to access it from the GUI tools which are installed on my actual machine (While jumpbox is in a VM on my actual machine)

On your VMWare player, click Alt + F1 to go to the console:

In console, write the following to get the root password:

sudo grep root /jumpbox/lib/appdata.yml


You will see a line such as the following:



root: pa$$word


where pa$$word is the password of your root user



To start using the db as the root user:



mysql -u root -p
#or
mysql -u root -ppa$$word


 



In order to allow remote access on the database, do the following:



sudo nano /etc/mysql/my.cnf


Find the bind-address property, and replace it with the IP of your jumpbox



e.g. I modified



#bind-address           = 127.0.0.1


to



#bind-address = 192.168.1.36



Restart mysql:



sudo /etc/init.d/mysql restart


Now grant all privileges to a remote db user



GRANT ALL PRIVILEGES ON *.* TO ria@'%' IDENTIFIED BY 'ria0';


where ria is the user name, and ria0 is the password of a remote user (this user need not be already existing in the db, it creates a new user if it does not exist)



Now download the GUI tools for mysql and try accessing the db using



db host: 192.168.1.36 (your jumpbox host)



user: ria



pw: ria0



I started receiving an error saying



host 'mycomputername' is not allowed to access this mysql



(I dont remember the exact error string sorry)



To solve this problem, i went back to the console and ran this command:



GRANT ALL PRIVILEGES ON *.* TO ria@'mycomputername' IDENTIFIED BY 'ria0';



(We can also use IP of the external machine instead of the computer name)



Now you will be able to access the joomla jumpbox database externally.



http://wiki.jumpbox.com/doc/runtime/faq/access_mysql



http://www.jumpbox.com/node/1101



http://www.cyberciti.biz/tips/how-do-i-enable-remote-access-to-mysql-database-server.html

Monday, January 18, 2010

MySQL GUI tools

http://dev.mysql.com/downloads/gui-tools/5.0.html

Using kickstart to restore a backup on jumpbox site

  • Browse to kickstart.php
  • choose a backup to restore from the dropdown
  • choose ftp mode
    • localhost
    • port 21
    • user
    • password
    • initial directory :- /
  • Click Start
  • When it asks for the db access:
    • Host: enter the IP of your jumpbox e.g. 192.168.1.36
    • user: user which has remote access enabled on the db
    • password
    • database name: (I was using the db of the existing site but it was giving me could not find the database error, so i created a new empty db and gave its name here, then the restore continued)

http://forum.joomla.org/viewtopic.php?p=1941542

Set up Joomla kickstart on JumpBox

While using WAMP, you can install kickstart this way:

I placed my Joomlapack archive file in the WWW directory of my WAMP.
I copied the extraced Kickstart files there.
I extracted the archive file into the WWW directory.
Then I went to http://localhost/administrator and a new Joomla installation began.
At the end of the installation, there was my site.

 

While using Jumpbox:

I installed Joomla pack on my joomla site, and then i extracted the contents of Kickstart in /storage/joomla15/
Also placed the backup file in the same folder. Then I browsed
http://192.168.1.36/kickstart.php

Thursday, January 14, 2010

autochk program not found – AUTOCHECK skipping

I resolved it by Start > Run > sfc /scannow

http://www.techspot.com/vb/topic7746.html

http://www.windowsbbs.com/windows-xp/46438-autochk-program-not-found.html

Bad array declarator: To declare a managed array the rank specifier precedes the variable's identifier. To declare a fixed size buffer field, use the fixed keyword before the field type

Wrong Declaration

char CopiedString[];

char[] CopiedString;

Correct Declaration

char[] CopiedString = new char[3];

char[] CopiedString = xyz;

http://dotnetdud.blogspot.com/2008/08/bad-array-declarator-to-declare-managed.html

"One or more field types are not installed properly. Go to the list settings page to delete these fields."

I received this error while using an SPQuery CAML query string. the problem was that I had renamed my Title column in the list to “Document Library Name” and in the SPQuery i was using

query.Query = "<Where><Eq><FieldRef Name='Document Library Name'/><Value Type='Text'>" + this.workflowProperties.List.Title  + "</Value></Eq></Where>";

after some research I found out that the internal name of the column was still ‘Title’ so i used

query.Query = "<Where><Eq><FieldRef Name='Title'/><Value Type='Text'>" + this.workflowProperties.List.Title  + "</Value></Eq></Where>";

and the error was gone :D

Wednesday, January 13, 2010

Create Folder using .NET

System.IO.Directory.CreateDirectory(@"c:\NewFolder");
System.IO.Directory.CreateDirectory(@"c:\NewFolder\NewSubFolder");

Access web.config from a Visual Studio WOrkflow

http://stackoverflow.com/questions/1592574/access-config-file-from-a-vs-sharepoint-workflow

Create a SharePoint feature in Visual Studio

http://code-journey.com/2009/03/25/how-to-create-a-new-feature-in-sharepoint-using-visual-studio/

Sharepoint feature receiver

http://www.nnihlen.com/blog/archive/2006/12/04/724.aspx

http://code-journey.com/2009/07/05/add-an-event-handler-feature-receiver-to-a-sharepoint-feature/

http://ivydotnet.spaces.live.com/blog/cns!F0ADF64956CA5930!291.entry

http://blog.tylerholmes.com/2008/03/walkthrough-creating-sharepoint-feature.html

http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/24f5e19c-4496-4f11-89be-2e24242a2e4e

http://dkeeling.spaces.live.com/blog/cns!1FF0B17B869C973!146.entry

Integrated Features not enabled in Virtual PC – Windows 7

I kept on receiving an error while trying to enable the integration features with virtual pc in windows 7.

with some R&D, I found out tht the administrator of the virtual PC had an empty password. So i set a password for that user.

Added my own user (which i was using to login to the VM) to remote users group and ensured that the VM allowed remote access

Document Library to FTP Upload

 

Private Sub onWorkflowActivated1_Invoked(ByVal sender As System.Object, ByVal e As System.Workflow.Activities.ExternalDataEventArgs)
       Try
                   Dim request As FtpWebRequest = CType(WebRequest.Create(ConfigurationManager.AppSettings("FTPHost") + Me.workflowProperties.Item.File.Name), FtpWebRequest)
           request.Method = WebRequestMethods.Ftp.UploadFile
           request.Credentials = New NetworkCredential(ConfigurationManager.AppSettings("FTPUser"), ConfigurationManager.AppSettings("FTPPassword"))
           Dim webCl As WebClient = New WebClient()
           webCl.Credentials = New NetworkCredential(ConfigurationManager.AppSettings("SPUser"), ConfigurationManager.AppSettings("SPPassword"))
           Dim buffer() As Byte = webCl.DownloadData(ConfigurationManager.AppSettings("CurrentSite") + Me.workflowProperties.Item.File.Url)
           request.GetRequestStream().Write(buffer, 0, buffer.Length)
           request = Nothing
       Catch ex As Exception

       End Try

   End Sub

Tuesday, January 12, 2010

The requested URI is invalid for this ftp command

http://www.eggheadcafe.com/community/aspnet/2/60622/ftp-uri-invalid.aspx

http://forums.asp.net/p/1233240/2242751.aspx#2242751

Uri target = new Uri("ftp://ftp.placer.dyndns.org/test.css");

URI formats are not supported.

I was using File.OpenRead(xyzURL) when i received this error. the solution was to use a webclient

http://forums.asp.net/p/959418/2592264.aspx#2592264

‘Access denied’ when deploying VS 2k8 Sharepoint workflow

(I couldnt get a resolution to this error but following is a workaround)

1. Create a directory in the features directory [C:\Program Files\Common Files\microsoft shared\Web Server Extensions\12\TEMPLATE\FEATURES] and drop both the feature.xml and workflow.xml files into the directory.
2. Install the feature on your farm, using the following command line statements
stsadm -o installfeature -name <<name>>
4. Activate the feature to a site collection
stsadm -o activatefeature –name <<name>> -url <<url>>
Replace <<name>> and <<url>> with the actual value

http://www.codeproject.com/KB/WF/sharepointworkflow.aspx?msg=2656569

***EDIT: Strange enough, I added System.Configuration reference in the project for some other purpose; and this error was gone :D

Monday, January 11, 2010

PSD to CSS

http://www.makeuseof.com/dir/psd2css/

http://www.psd2cssonline.com/

http://www.devwebpro.com/creating-css-layouts-the-best-tutorials-on-converting-psd-to-xhtml/

document.createElement not working on Firefox

document.createElement was working in all browsers other than FF.I changed this part

   1: var newElement = document.createElement("<input name='"+elementName+"' id='" + elementName + "' type='hidden'>");


to this:




   1: var newElement = document.createElement("input");



   2:  newElement.setAttribute('name',elementName);



   3:  newElement.setAttribute('id',elementName);



   4:  newElement.setAttribute('type','hidden');


and i got it working in all browsers


http://www.dustindiaz.com/add-and-remove-html-elements-dynamically-with-javascript/


http://www.eggheadcafe.com/community/aspnet/3/41127/firefox-createelement--a.aspx

Wednesday, January 6, 2010

Call server side methods from client side

I know of some ways to do the above but this was really one of the simplest ways to do it.

http://usmanshabbir.blogspot.com/2009/10/simplest-way-to-call-server-side.html