PDA

View Full Version : Relevant Store Products on Threads & Search (vB4)



PhucSD
14-07-2011, 08:21 AM
Mod này giúp hiển thị những sản phẩm bạn muốn quảng cáo, nhưng dữ liệu này được lấy từ database hay từ nguồn khác, những sản phẩm sẽ hiển thị bên trên mỗi chủ đề, đồng thời những sản phẩm này cũng sẽ xuất hiện lúc bạn tìm kiếm trong forum.

Đọc kĩ hướng dẫn bên dưới và xem screenshot sẽ hiểu công dụng của nó


This hack will use data from your online store database (or whatever data source you want) and determine which are the most relevant products to show at the top of a thread. It will also show relevant products related to search queries.

It accomplishes this task by some clever javascript that gets the most common occurrences of words / phrases in your posts, and does some clever mysql logic to figure out what is most relevant.

This hack comes with an option for users with over 50 posts to turn OFF seeing these products.
You need to make 2 template modifications, add some CSS and Javascript, and drop in the PHP files. Also add 1 field to the user table (sql statement included) Then edit the relevantProducts.php file to match whatever data you have. Its setup right now for a Volusion API export.

Files:
relevantProducts.php
relevantProductsAjax.php
RP-plugins.txt
RP-search template changes.txt
RP-box template.txt
RP-css.css
RP-debugging.php
RP-hide/show template changes.txt
RP-jQuery Plugin.js
RP-jQuery Plugin Usage.js
RP-sql.sql

http://www.mp3car.com/images/relevantSearch.png
http://www.mp3car.com/images/relevantThread.png


To make this better for later, your store might also give you product popularity, something our store does not. Factoring that in would increase the relevance of the products.