I've been working on a webcomic website for a while now but for a few weeks now I've been stuck on the comic viewing part.
In theory, what I'm trying to do is grab images from the WordPress post and store them in a PHP Array variable and show 1 element of the Array at a time through Javascript.
Can anyone help out?
Since many details are not mentioned I will try to answer as best as I can from whatever you have mentioned.
In case I have access to theme functions I will try to get the post attachments as array of URLs and render them wherever I want to with the help of slider to achieve one image at a time. In case I am not able to extract the post attachments I will get the url of post, get the html crawl to container which holds the post content and extract the image tags and display them where ever I want to again with the help of slider
Related
I am creating a plugin for a theme am using the theme has multiple fields and i field them all using both custom data and fields.
But i am missing something, the plugin creates multiple posts using wp_insert_post Function
but only 1 or upto 3 posts will display in the theme, and if i click update to 1 post on the wordpress editor all the posts show at once as if fixed but there is no additional fields added to the posts meta fields so am confused.
I checked the cache, also when i disable the theme and enable it again all the posts show up so where is the issue coming from and how do i fix this.
Please Help, much appreciated.
After a Long Struggle i had to read the theme Structure and how it displays its posts and inserts them and found that they have been submitting the posts id's in a file.
So how it works is
when you load the post page the theme requests for posts from file it checks if file exists and time last updated and if time last updated post in database and time last updated file are the same it displays the post id's inside the file.
Conditional Else it updates the file and add the posts id's currently in the database inside the file.
So basically the theme doesn't sort posts directly from the database but file So?
I changed the theme display and make it request Directly from database.
I can't believe it's a very popular theme with a messy code structure.
Well that's all hope it helps those who face same problem.
Else you can ask in this thread i will help if i am able to i am not expert but have been coding for 4 years and still get frustrating bugs like this and it could be that i am impatient eitherway, Jaa :)
I want to scrape data from a website within my java-application. The data I want to collect is inside a html-table-element. I tried two different methods:
I tried to load the website with a BufferedReader into a String and collect the data from the String.
I tried to use Jsoup to get access to the exact html-element, but it's empty.
Turns out that the table exists, but it is empty as long as the user has not pressed a button (labled "load raw data"). I inspected the sourcecode of the webpage. When the user presses the button, a load_table()-function is called which loads the data into the table. Obviously, the URL remains the same, otherwise I could've just used the other URL where the data is already loaded into the table. Has anyone an idea on how to scrape data from a website although it's only on the website if the user presses a button after the website is loaded?
I'm not really a trained Javascript-coder, but I tried to look through the script which is executed after the user presses the button. It's kind of hard to understand for me but I made a pastebin of the script with a highlighting where I think the rows are added to the table if that helps. The code for the button is:
Load raw data
The code I use to access the html element with Jsoup would be (all the child(x) methods are called on different div-elements to go deeper into the html-document until I finally reach the table-element):
Jsoup.connect(url).get().body().children().get(5).child(0).child(4).child(1).child(1);
As I stated above, the element is empty. I hope the description of my problem is detailed enough and somebody has at least an idea of what I'm trying to say. Sorry for my clumsy expressions. Not a native speaker.
if you are familiar with selenim webdriving you could use selenium to load the page and then pass to source page into beautifulSoup argument.
html = pageSource()
you could parse the page by this method i guess
A user would click a submit button and a function would create a div in a gallery on my site with which they could link to if they wanted to share that content specifically. The content is just embedded and hosted on other sites like youtube so the user would not be actually uploading any content or need an account. It's a free open gallery that anyone could copy a url and paste into an input and submit that content into a div in the gallery.
Any ideas where to start? Would this require php?
Well if you're a super beginner or something the first step would be to make your website just the way you want it and inside these div's you can just put the url that the user submitted instead of the content that url points to. [If you can do this then I assume you wouldn't need to ask this question, so don't mind me treating you like a complete beginner]
How would you achieve this? Well you're definitely need:
Some sort of server side language (php is a good choice) that allows you to use the input from the user (The POST request from the form he/she submits),
Check it for correctness / clean up the input / supported websites, etc.
Save this information somewhere (a database) so that you can get it back later.
The next steps would be to now get the information from the database and show it on your gallery page like you want it. This involves:
Getting whatever subset of information you want to display on a particular page from the database. Perhaps only cat related things or something, I don't know.
Just displaying it in your div's using a for loop or something.
.
foreach ($subset as $url) {
echo "<div>$url</div>";
}
Then the last step would be to convert these links into actual videos / images or whatever depending on the type of link. This can be done both client side using Javascript / server side using php or some other language.
This is going to be a lot of manual work, looking through every websites api and figuring out how to convert a url into a video for example. Images are easy but they may be hotlink protected so you might have to go through an API there as well.
Please this question is just a request for guide. No coding had been started yet but based on recommendations, I will begin the coding. I am still new to JQuery.
I want to load all my blog posts using JSON API plugin. I have been able to create the code to load the posts and limit it to just 3 posts out of 11 posts.
I just want to know what the best approach or sequence is to add a link so when someone clicks on it, it then looks through the already displayed posts, checks for the last posts and then appends the next 3 posts until all 11 posts had been displayed before it either hides the Load more link or greys it out.
Please I just need someone who had done something similar to this to advise on the sequence to use.
Create a Load function to load the first 3 posts and store in a div (id=postcontent)
Create a click function that on clicking a class element (.loadmore), checks content of existing div (id=postcontent), does a count, compares the count to total of posts in json data (11), then looks for last post and appends another 3 posts and does a refresh to maintain the markup
New to HTML javascript programming and have an issue with implementation of my page.
I have created multipage HTML form layout(using div) which runs 4 pages with approximately 140 input values(most are optional values) all together. I need to implement a preview page before actually submit where in only filled input values along with their labels are displayed within a section of the page.I am able to collect the filled input values and the label values to an array using javascript. However the issue is, I am not able to figure out how I can pass these values to the actual in html summary page? I cannot implement .innerHTML as my labels need to be dynamically generated based on input values. Can this even be done just by javascript or HTML or do I need a server side script to implement the preview page? Does learning DHTML or AJAX help to implement a solution to this problem? I appreciate all the help. Let me know if I need to explain better.
The BEST way would be a session variable in a server-side language. If security is not an issue though, you can save the variables into a cookie though javascript.
See here.