Dynamic lists (JQuery) and retrieving the data - php

I have arrived at a wall in my project. I am trying to create a way that a user can add a url to the database (associated with there user id) and then that can be read as a feed (using SimplePie).
I am trying to make it so that the name of the feed (when they add a feed they give it a name) is displayed in a list. And then when they click on the name a drop down appears under the name with all the latest articles from that feed in it.
Does anyone know a way that I can build an order-able list from the urls associated with the current logged in user id and then create the drop down for each individual list item that displays the lastest articles in the drop down.
So far I have managed to create the form for saving to the database and I have created a drop down. I just don't know how to create it all dynamically (depending on how many results are returned depends on how many items are displayed).
Thanks in advance!

Related

How to get current stage from Sharepoint 2013 with PHP

I want to make a website using following sharepoint api: http://zurb.com/forrst/posts/PHP_Read_and_write_to_SharePoint_Lists-PRF
I can easily retrieve my list, I can color or do whatever to that information in that list, but I want to get the current step of the workflow and make a red box under it and after is done a green box around it with arrows between them, to show they are connected. Is this something that can be done using PHP?
Thank you.
When you attach a workflow to a list it will create a column in the list with the same name as the workflow. It won't appear in List Settings, but will show in the list of fields to include in the list view. To get the stage(In Progress, Completed, etc.,) of a workflow is basically the same as reading any other column in a list.

PHP pages dynamically?

I'm not asking any coding question, I'd just like to know what the 'standard' practice is. If I had PHP spit out a table or list of names/items from a database and then when you click on one of the names/items it then takes you to that page, should these pages be made dynamically or not?
For example, if it was a list of musicians, and then when you click on a musicians name it takes you to a list of their albums and then when you click on the album it has the track list, should these links/pages be done dynamically or is it best to make each musicians page normally. Basically, what I'm asking is should PHP be used to make each page or just to echo out the tables from the database.
Thank you.

WP - Button for creating timestamp in db

Heller,
I'm working on a plugin and I've just totally hit a wall. I'm wanting to create a plugin, if you will, for wordpress where the user that's logged in would be able to navigate to, select an option from a dropdown menu, hit a button and have an entry added to a db. I'm wanting two databases created on the initial button click and then every button click after would append to the database that corresponds to the current user and the option selected. So, for example let's say I have Joe Smith. He logs in and navigates to, let's call it "Time Clock" in the wp menu. Upon loading, he has the option to select the location he is at and click, clock in. If this is first time "clocking in", wp creates two databases, one for "joe_smith" that would record a timestamp of when he hit the button and also the location he was at when he hit it. The other database would be named after the location and would record the date and time and who the user was who was at the location. After that, if Joe came back later in the day and was at the same location and selected the same properties, it would add another row of in "joe_smith" database and another row in "a_location"s row as well. If he changed locations it would still add to "joe_smith"s database but would create/append to the new locations databse "new_location".
Ideally I'd like to have the locations in a dropdown menu and that is populated by another db that houses all the location information and is editable by the admin. Am I on the right track with my thinking about how to set this up best? Anyone have any pointers or the ability to spit this code out easily? Haha. I've been doing my best at learning the wp system and how to create plugins and my deadline is coming up quickly to have something that functions. Thank you in advance to anyone that can help me on this :)
I would suggest that you split up the logic for creating the database and whatever needs to happen when the user clicks the button. In particular:
create a table when the plugin is activated (use register_activation_hook). More information about standard practices for this.
make your plugin store the available locations in WordPress' options table (use its API for managing it and create an appropriate options page for your plugin to manage them).
when the plugin is uninstalled (not deactivated), drop the table to leave everything as it was (using register_uninstall_hook).
when the user clicks the button, add an entry to your table (that will obviously need to - at least - contain a timestamp, the userid and the location).

How to store and retrieve an image and description from a database and make it view able by the a set member

This is a pretty long and hefty question. First off I am new to PHP but I know javascript and HTML as well as CSS. I have created the static elements of a webpage and have managed to integrate it with a login and signup premade php layout, so currently users can signup and login for the site. However the key element remains; the user should be able to select an item from the database and upon selection that item should be "pinned" to a specific div.
e.g. The user clicks on a button below "image.div", when the user clicks on this button a modal pops up with some choices, the user have to select a choice which then loads further information for the user to see. Upon getting this information the user clicks "pin" and the modal closes and that specific choice is "pinned" to "image.div". Each individual "image.div" will have it's own category, e.g. hotels, car rentals, restaurants etc. Ence when selected only the assigned category is displayed by "image.div".
The "pinned" object should only be view able by the user that pinned it when that user logs in.
I also want the choice within the popup modal to be searchable by keywords e.g. kingston, New York etc.
The database that came with the php login scripts have the following table: fgusers
The table has the following columns: id_user, name, email, phone_number, username and password.
In addition to the above information request I would also like to know how to structure the database for this, should I extend the fgusers table? or should I create separate tables for each?
A response would be greatly appreciated.
If I understand your question correctly then, the best way to achieve the effect you are after is to use AJAX to access database info via a PHP script. Then use javascript to manipulate the xmlhttp result.
As far as the MySQL database tables go, it is better to create separate tables for the different information. You will need to create a column in each table that references an identifying column in the table you want to link that particular tables information to.
Then you just have to use the JOIN commands when referencing the table data.
Example: if you want to link data to specific users you can add a username column to the table and add the users name to the data row. Later when you want to retrieve that users data, just reference the users name. If there are multiple tables of user data, use the JOIN command to link the tables together.

jQuery/PHP-MySQL News Ticker

I have been searching for a Vertical Text Slider OR Vertical News Ticker, exactly like this one:
http://www.tradekey.com/
(scrolling the latest buy/sell offers in the middle)
I found few tickers but I still can't figure out how do I make it to get data from one specific MySQL table & display them randomly.
Someone point me to right direction or provide me any link where I can found any easy to configure news ticker.
UPDATE-171212:
Well I checked the ajax folder, there are some files getting user info from db.
But it always displays the country info from the member profile, by ignoring what is mentioned in the "buying/selling lead" info.
its using $country, & its same in both member profile info table & buying/selling leads table.
What if I want it to pick from buy/sell leads, & if no country is mentioned then get country data from member profile.
For Example:
http://www.tradeglobus.com (import export trade leads in the middle)
I have to correct country info issue in this one.
Look into setInterval mixed with AJAX to update a list of the items you want to display. Then look into Jquery to add a ticker effect.
To elaborate, create a file that fetches the items from a DB. Then use an ajax request to get that list at regular intervals. From there it just takes a Jquery plugin or equivalent to display the list in ticker form

Categories