Jump to content

Search the Community

Showing results for tags 'user favorites'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk

Product Groups

  • Form Builder
  • ProFields
  • ProCache
  • ProMailer
  • Login Register Pro
  • ProDrafts
  • ListerPro
  • ProDevTools
  • Likes
  • Custom Development

Categories

There are no results to display.


Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

Found 1 result

  1. Hi All, I am wondering if you could provide input on the best way an item as a user favorite. I am setting up a price comaprison website, and have most of the logic done for the site. Search results, listing page, login/logout, search, etc. It's all looking pretty good. However someone has suggested to me that users might like to save an item as a favorite. So my idea behind that was to have a button on each of the grid items in the search results page. This is my search results page code with the button within the item. <form id="add_fav" name="add_fav" autocomplete="off" accept-charset="utf-8" action="./" method="post"> <button class="wish_btn" name="add_fav">Add Fav</button> </form> Where the business logic is on the page, this is what I have so far - I just don't know how to align an item to a user. $log->save ('pageview', 'testing'); function clense_input($data){ $data = trim($data); $data = stripslashes($data); $data = htmlspecialchars($data); return $data; } $sort = "title"; // Logic for favorites if ($_SERVER["REQUEST_METHOD"] == "POST") { if (isset($_POST['add_fav'])) { $favs = $sanitizer->text($_POST['add_fav']); if(!empty($favs)){ $ticket = $pages->get($favs); // Set page name if($favs != null){ $favs->of(false); $favs->fav_title = $page->user->name; // Save username $favs->fav_title = $page->title->id; // Save page id to favs list $favs->save(); echo "Fav saved."; } } } }
×
×
  • Create New...