I am trying to make a table on my website display images and text based on the data of another hidden table that is easily pasted into the website.
I feel like this should be pretty simple but I do not know where to begin looking. I dont know if this is similar to scraping another site or if there is a wordpress plugin where I can make a certain input display certain things in a table.
Thanks
EDIT - Forget scraping, I just want to display something based on something I paste in that is hidden.
I have a stylized table and a table that with the data that will be pasted in. I want the data in the pasted in table to show in the stylized table, but if the data is, for example "123", I don't want it to display "123" but a certain image instead.
Related
I'm currently trying to develop my own website from scratch as I try and teach myself more about web development. I'd like to work out how to have a section on my website that displays blog posts I write, but without having to edit the HTML each time I write a post. I'd like a separate page where someone can write a blog, then when they press submit, it will add it to the website.
I've had a nose about online and a think about it. I'm guessing this is like a content management system, but I'm unsure if this is something I should try and manually code myself or if there's common practice out there for this sort of thing.
My thoughts on how to tackle the problem would be as follows. I'm guessing blog posts will need to be stored in a database. On the page that displays blog posts, it won't contain hard coding of any blog posts, but instead they will be pulled from a database and displayed. So you'd need to write code that will extract records from a database and display the heading / content as you desire, with a separator between posts. And you limit maybe to fetching X amount of posts from the database at a time. Then with regards to the writing of posts, I'd need to make a webpage that you log in to, and write a blog post as if it was a form and submit it to the database via Php or something? I appreciate this may not included a fancy text editor while writing a blog post, mind.
I'm sorry if this isn't the right type of question for stackoverflow. I know I've not presented code for you to help with, but it is about how these things are coded - so I don't start working on something redundant. Thanks for reading.
(FYI: My experiences so far are creating a website that uses HTML, CSS and a small amount of Javascript, using PHP and MYSQL. I've created a log in system, and allowed users to add, edit and delete records via forms. I've displayed information from databases in forms and tables.)
Store everything in database.
Simple way (you can make it complicated later),
table structure:
MainTable
text_id(Primary Key),
used_id(Foreign Key),
approved(allowed to be displayed),
text(text body)
User(You) with access to admin panel.
Admin Panel page to approve texts to be displayed.
select * from MainTable WHERE approved = 0
You have all unapproved texts.
UPDATE MainTable SET approved = 1 WHERE text_id = /this text id/
Now it can be displayed.
Page where you want display texts.
You would have to identify user with user_id to get his texts.
SELECT * from MainTable WHERE user_id = /this user id/ and apporoved = 1
display texts.
Page creating in PHP: I'm trying to learn how to make a cms but I couldn't understand something. For example in Wordpress when you click "create a new page" button what is happening at the backside? For example now I don't have any page.
I want to create these pages dynamically:
Home
About
Contact
After I want to add this pages in my menu. What is the best way to do that?
Questions:
Should I create a new php file to do this or just get data from my database which belongs to each page?
How I add these pages in my menu dynamically ?
What is htaccess? I couldn't understand that exactly it does relating the the processes of the files.
There are tutorials on internet but they always show how to get articles from database. When I have another item (for example a slider) I need a real page.
Can somebody suggest me a simple tutorial, or provide a clear explanation which explains the logic simply.
I have created something similar. This is how I did it (may not be the best way but it is certainly the easiest).
Create a template file and insert tags (!Title!, [[Title]], etc) where you want the new pages data to be inserted.
When creating a new page, read the contents of the template and replace the tags with the data submitted (I used titles, desc, h1, etc but this can also be achieved through a simple content function)
The user selects/creates the directory using mkdir()
All this is then stored in DB ready for the user to navigate to.
You can then use the DB entries to build a navigation menu
Okay... so here is what I'm trying to do. Basically all of the components that make up any particular page on a Wordpress site, I need to be able to grab the query that WP is running to grab the data for that particular area of the given page. So, if we have page A, let's say it has a top navigation, main content section, and footer. Each of these three areas have content that is pulled from the database. I need a generic way to say on page X I want to know what queries have been ran to generate all of the content pulled from the database and displayed on the page.
I feel like the key is to properly use https://codex.wordpress.org/Class_Reference/WP_Query to get the data I need.
Any thoughts on how I could go about this?
I'm building a two column content section on my website that allows a user to select an example of a font, enter a string of text, and click a button in the right column and in the left display the selected font and text the user has chosen.
I have looked at the PHP website and don't even know where to start. I'm used to dealing with databases and forms in PHP for gathering data but have never attempted something like this before.
I feel like it should be pretty simple so any help or hints are appreciated.
I would like to use fonts from: http://www.tattoo-fonts.com
I'd like to show my latest blog post as a teaser on the front page of my personal website, in a div. Ideally it would even have a word limit -- maybe the first 100 words and then an ellipsis and link to the actual blog along with date and time.
Additional my blog is not attached on my website (so that I can't access it's database). My blog may be saved on like: blogspot.com etc..
I assume that everything is self-coded, so we don't have any abstractions or something. If you run a blog and a website there's probably some database or two. You'll seed to write SQL query that gets latest post from posts table and run it somewhere inside you website's code. If you have that data use field storing post's date, time and full text and extract 100 words [non trivial problem if you have HTML inside] and display them in a proper template file of your website.