647. Except as provided in paragraph (8) of subdivision (b) and subdivision (l), a person who commits any of the following acts is guilty of disorderly conduct, a misdemeanor:

(a) An individual who solicits anyone to engage in or who engages in lewd or dissolute conduct in any public place or in any place open to the public or exposed to public view.

(b) (1) An individual who solicits, or who agrees to engage in, or who engages in, any act of prostitution with the intent to receive compensation, money, or anything of value from another person. An individual agrees to engage in an act of prostitution when, with specific intent to so engage, he or she manifests an acceptance of an offer or solicitation by another person to so engage, regardless of whether the offer or solicitation was made by a person who also possessed the specific intent to engage in an act of prostitution.

(2) An individual who solicits, or who agrees to engage in, or who engages in, any act of prostitution with another person who is 18 years of age or older in exchange for the individual providing compensation, money, or anything of value to the other person. An individual agrees to engage in an act of prostitution when, with specific intent to so engage, he or she manifests an acceptance of an offer or solicitation by another person who is 18 years of age or older to so engage, regardless of whether the offer or solicitation was made by a person who also possessed the specific intent to engage in an act of prostitution.

(3) An individual who solicits, or who agrees to engage in, or who engages in, any act of prostitution with another person who is a minor in exchange for the individual providing compensation, money, or anything of value to the minor. An individual agrees to engage in an act of prostitution when, with specific intent to so engage, he or she manifests an acceptance of an offer or solicitation by someone who is a minor to so engage, regardless of whether the offer or solicitation was made by a minor who also possessed the specific intent to engage in an act of prostitution.

(4) A manifestation of acceptance of an offer or solicitation to engage in an act of prostitution does not constitute a violation of this subdivision unless some act, in addition to the manifestation of acceptance, is done within this state in furtherance of the commission of the act of prostitution by the person manifesting an acceptance of an offer or solicitation to engage in that act. As used in this subdivision, “prostitution” includes any lewd act between persons for money or other consideration.

(5) Except as provided in paragraph (6) and subdivision (k), a violation of paragraph (2) or (3) is punishable by imprisonment in a county jail for not less than 72 hours and not more than six months and by a fine of not less than two hundred fifty dollars ($250) but not exceeding one thousand dollars ($1,000). An amount of two hundred fifty dollars ($250) of the fine shall be deposited in the treasury of the county in which the offense occurred and used by the county to fund services for victims of human trafficking. Upon a violation of paragraph (2) or (3), a person is not eligible for release upon completion of sentence, on probation, on parole, on work furlough or work release, or on any other basis until he or she has served a period of not less than 24 continuous hours in a county jail. In all cases in which probation is granted, the court shall require as a condition of probation that the person be confined in a county jail for at least 24 hours. The court shall order that a person punished under this subdivision, who is to be punished by imprisonment in the county jail, be imprisoned on days other than days of regular employment of the person, as determined by the court. If the court determines that 24 hours of continuous imprisonment would interfere with the person’s work schedule, the court shall allow the person to serve the imprisonment whenever the person is normally scheduled for time off from work. The court may make this determination based upon a representation from the defendant’s attorney or upon an affidavit or testimony from the defendant.

(6) If a defendant violates paragraph (3) and knew or should have known that the person who was solicited was a minor at the time of the offense, or if a defendant violates paragraph (2) and the person who was solicited was a person posing as a minor and the defendant had specific intent to solicit a minor, the violation is punishable by imprisonment in a county jail for not less than 72 hours and not more than one year and by a fine of not less than one thousand dollars ($1,000) but not exceeding ten thousand dollars ($10,000). The fine imposed shall be deposited in the treasury of the county in which the offense occurred and used by the county to fund services for victims of human trafficking. Upon a violation of this paragraph, a person is not eligible for release upon completion of sentence, on probation, on parole, on work furlough or work release, or on any other basis until he or she has served a period of not less than 48 continuous hours in a county jail. In all cases in which probation is granted, the court shall require as a condition of probation that the person be confined in a county jail for at least 48 hours. The court shall order that a person punished under this paragraph, who is to be punished by imprisonment in the county jail, be imprisoned on days other than days of regular employment of the person, as determined by the court. If the court determines that 48 hours of continuous imprisonment would interfere with the person’s work schedule, the court shall allow the person to serve the imprisonment whenever the person is normally scheduled for time off from work. The court may make this determination based upon a representation from the defendant’s attorney or upon an affidavit or testimony from the defendant.

(7) This subdivision does not prohibit prosecution under any other law.

(8) Notwithstanding paragraphs (1) to (3), inclusive, this subdivision does not apply to a child under 18 years of age who is alleged to have engaged in conduct to receive money or other consideration that would, if committed by an adult, violate this subdivision. A commercially exploited child under this paragraph may be adjudged a dependent child of the court pursuant to paragraph (2) of subdivision (b) of Section 300 of the Welfare and Institutions Code and may be taken into temporary custody pursuant to subdivision (a) of Section 305 of the Welfare and Institutions Code, if the conditions allowing temporary custody without warrant are met.

(c) Who accosts other persons in any public place or in any place open to the public for the purpose of begging or soliciting alms.

(d) Who loiters in or about any toilet open to the public for the purpose of engaging in or soliciting any lewd or lascivious or any unlawful act.

(e) Who lodges in any building, structure, vehicle, or place, whether public or private, without the permission of the owner or person entitled to the possession or in control of it.

(f) Who is found in any public place under the influence of intoxicating liquor, any drug, controlled substance, toluene, or any combination of any intoxicating liquor, drug, controlled substance, or toluene, in a condition that he or she is unable to exercise care for his or her own safety or the safety of others, or by reason of his or her being under the influence of intoxicating liquor, any drug, controlled substance, toluene, or any combination of any intoxicating liquor, drug, or toluene, interferes with or obstructs or prevents the free use of any street, sidewalk, or other public way.

(g) When a person has violated subdivision (f), a peace officer, if he or she is reasonably able to do so, shall place the person, or cause him or her to be placed, in civil protective custody. The person shall be taken to a facility, designated pursuant to Section 5170 of the Welfare and Institutions Code, for the 72-hour treatment and evaluation of inebriates. A peace officer may place a person in civil protective custody with that kind and degree of force which would be lawful were he or she effecting an arrest for a misdemeanor without a warrant. A person who has been placed in civil protective custody shall not thereafter be subject to any criminal prosecution or juvenile court proceeding based on the facts giving rise to this placement. This subdivision shall not apply to the following persons:

(1) Any person who is under the influence of any drug, or under the combined influence of intoxicating liquor and any drug.

(2) Any person who a peace officer has probable cause to believe has committed any felony, or who has committed any misdemeanor in addition to subdivision (f).

(3) Any person who a peace officer in good faith believes will attempt escape or will be unreasonably difficult for medical personnel to control.

(h) Who loiters, prowls, or wanders upon the private property of another, at any time, without visible or lawful business with the owner or occupant. As used in this subdivision, “loiter” means to delay or linger without a lawful purpose for being on the property and for the purpose of committing a crime as opportunity may be discovered.

(i) Who, while loitering, prowling, or wandering upon the private property of another, at any time, peeks in the door or window of any inhabited building or structure, without visible or lawful business with the owner or occupant.

(j) (1) Any person who looks through a hole or opening, into, or otherwise views, by means of any instrumentality, including, but not limited to, a periscope, telescope, binoculars, camera, motion picture camera, camcorder, or mobile phone, the interior of a bedroom, bathroom, changing room, fitting room, dressing room, or tanning booth, or the interior of any other area in which the occupant has a reasonable expectation of privacy, with the intent to invade the privacy of a person or persons inside. This subdivision shall not apply to those areas of a private business used to count currency or other negotiable instruments.

(2) Any person who uses a concealed camcorder, motion picture camera, or photographic camera of any type, to secretly videotape, film, photograph, or record by electronic means, another, identifiable person under or through the clothing being worn by that other person, for the purpose of viewing the body of, or the undergarments worn by, that other person, without the consent or knowledge of that other person, with the intent to arouse, appeal to, or gratify the lust, passions, or sexual desires of that person and invade the privacy of that other person, under circumstances in which the other person has a reasonable expectation of privacy.

(3) (A) Any person who uses a concealed camcorder, motion picture camera, or photographic camera of any type, to secretly videotape, film, photograph, or record by electronic means, another, identifiable person who may be in a state of full or partial undress, for the purpose of viewing the body of, or the undergarments worn by, that other person, without the consent or knowledge of that other person, in the interior of a bedroom, bathroom, changing room, fitting room, dressing room, or tanning booth, or the interior of any other area in which that other person has a reasonable expectation of privacy, with the intent to invade the privacy of that other person.

(B) Neither of the following is a defense to the crime specified in this paragraph:

(i) The defendant was a cohabitant, landlord, tenant, cotenant, employer, employee, or business partner or associate of the victim, or an agent of any of these.

(ii) The victim was not in a state of full or partial undress.

(4) (A) Any person who intentionally distributes the image of the intimate body part or parts of another identifiable person, or an image of the person depicted engaged in an act of sexual intercourse, sodomy, oral copulation, sexual penetration, or an image of masturbation by the person depicted or in which the person depicted participates, under circumstances in which the persons agree or understand that the image shall remain private, the person distributing the image knows or should know that distribution of the image will cause serious emotional distress, and the person depicted suffers that distress.

(B) A person intentionally distributes an image described in subparagraph (A) when he or she personally distributes the image, or arranges, specifically requests, or intentionally causes another person to distribute that image.

(C) As used in this paragraph, “intimate body part” means any portion of the genitals, the anus and in the case of a female, also includes any portion of the breasts below the top of the areola, that is either uncovered or clearly visible through clothing.

(D) It shall not be a violation of this paragraph to distribute an image described in subparagraph (A) if any of the following applies:

(i) The distribution is made in the course of reporting an unlawful activity.

(ii) The distribution is made in compliance with a subpoena or other court order for use in a legal proceeding.

(iii) The distribution is made in the course of a lawful public proceeding.

(5) This subdivision shall not preclude punishment under any section of law providing for greater punishment.

(k) (1) In any accusatory pleading charging a violation of subdivision (b), if the defendant has been once previously convicted of a violation of that subdivision, the previous conviction shall be charged in the accusatory pleading. If the previous conviction is found to be true by the jury, upon a jury trial, or by the court, upon a court trial, or is admitted by the defendant, the defendant shall be imprisoned in a county jail for a period of not less than 45 days and is not eligible for release upon completion of sentence, on probation, on parole, on work furlough or work release, or on any other basis until he or she has served a period of not less than 45 days in a county jail. In all cases in which probation is granted, the court shall require as a condition thereof that the person be confined in a county jail for at least 45 days. The court shall not absolve a person who violates this subdivision from the obligation of spending at least 45 days in confinement in a county jail.

(2) In any accusatory pleading charging a violation of subdivision (b), if the defendant has been previously convicted two or more times of a violation of that subdivision, each of these previous convictions shall be charged in the accusatory pleading. If two or more of these previous convictions are found to be true by the jury, upon a jury trial, or by the court, upon a court trial, or are admitted by the defendant, the defendant shall be imprisoned in a county jail for a period of not less than 90 days and is not eligible for release upon completion of sentence, on probation, on parole, on work furlough or work release, or on any other basis until he or she has served a period of not less than 90 days in a county jail. In all cases in which probation is granted, the court shall require as a condition thereof that the person be confined in a county jail for at least 90 days. The court shall not absolve a person who violates this subdivision from the obligation of spending at least 90 days in confinement in a county jail.

(3) In addition to any punishment prescribed by this section, a court may suspend, for not more than 30 days, the privilege of the person to operate a motor vehicle pursuant to Section 13201.5 of the Vehicle Code for any violation of subdivision (b) that was committed within 1,000 feet of a private residence and with the use of a vehicle. In lieu of the suspension, the court may order a person’s privilege to operate a motor vehicle restricted, for not more than six months, to necessary travel to and from the person’s place of employment or education. If driving a motor vehicle is necessary to perform the duties of the person’s employment, the court may also allow the person to drive in that person’s scope of employment.

(l) (1) A second or subsequent violation of subdivision (j) is punishable by imprisonment in a county jail not exceeding one year, or by a fine not exceeding two thousand dollars ($2,000), or by both that fine and imprisonment.

(2) If the victim of a violation of subdivision (j) was a minor at the time of the offense, the violation is punishable by imprisonment in a county jail not exceeding one year, or by a fine not exceeding two thousand dollars ($2,000), or by both that fine and imprisonment.