So many stories from the Indian mythology are dumbed down for telling to children, and introduce a "magic" element to explain away sex-related activites, and sexual deviation. The best example of this is the "mantra" that Kunti recieved from Durvasa, to conceive babies from any "celestial force". Let's just say a sage met a young woman in the woods, and the woman had some kids. If someone asked, the children were fathered by celestial beings.
Anyway, there is an absolutely amazing story about Shiva, which is told often, but never like this, which is what the story very clearly means.
So Vishnu and Brahma, two of the three aspects of the Supreme Godhead in the Hindu Belief system* (Shiva is the third). These are all parts of Trimurti, but Vishnu and Brahma had an ego-war of sorts. Vishnu wanted to prove to Brahma that Vishnu was more powerful, whereas Brahma wanted to convince Vishnu that Brahma was more powerful. Basically Brahma and Vishnu had a face-off to determine who was the greatest. At that moment, Shiva revealed his dick across the three dimensions of space, hell, heaven and earth. Brahma and Vishnu ran around the cosmos, looking for the beginning, or the end of Shiva's massive cock. Then Shiva spoke to them, and told them that even my dick has more power than the two of you, and from now on, to prove it, humans will worship my dick and hold it at higher esteem than either Vishnu or Brahma. From that day onwards, whoever worships Shiva, worships the Shivlingam. Infact, the true Shivbakth (Shiva-worshipper) will know that worshiping the lingam (dick) is the preferred form of Shivbakhti (Shiva-worship). True story, and the reason why Vaishnavites (Vishnu worshippers) and Shaivites (Shiva-worshippers) cannot stand each other till this day.
However, the matter was between the Gods. Apparently, Shiva needs you to worship fossil stones found on the bottom of some river, as a sign that you also worship lord Vishnu, who is said to reside in these fossil shells.
*Ok, A Hindu belief system, some Hindus still worship elemental forces, or a female supreme Godhead known as Mata Devi.