wordpress image uploads - wordpress

I have created my own upload function for forms on my sites frontend. the images upload correctly, but in some cases a blank reference to the image with this as its path: /USR/WWW/USERS//WP-CONTENT/BLOGS.DIR/2/FILES/ occurs in the media library. its seems as though the form uploads images but where there is no image to upload a blank reference is 'uploaded' instead. any ideas of what may be causing this? deleting these empty rows in the db does not affect the site, but seems like bad practice.

I agree with Andrew Bolster, we need a bit more information to help you.
However, based on my own experience, it might be a problem with the filenames themselves. I found WordPress's own function for creating filenames, santize_file_name(), and that saved me a lot of trouble personally.
Check out the details here: http://codex.wordpress.org/Function_Reference/sanitize_file_name

Related

Wordpress images no longer have srcset and are showing pixalated images

I just recently moved my wordpress site to another host. There were too many images to import so I imported them through ftp and then used the [Add from Server plugin][1] to ensure my image id and such were in the database.
Images on my new site now show up however they are very pixalated and blurry as they are showing a small image blown up to 100%. I have tried regenerating thumbnails but have had no luck. It is the saem theme with the same code.
My old site image look like this:
Where my new site looks like this:
The images are all in the media library and i I swap them in one by one it wokrs but there are hundreds of posts. Is there a way to get this to work manually somehow? I thought this is what Regenerate Thumbnails was supposed to do. thanks for any help you can give.
I just check and my excerpts are not showing either.
If I understood correctly, you uploaded images via FTP. I assume folder structure is intact - year/month folder structure inside uploads folder. That should work without any other actions. Did you try? I don't understand part where you say "to ensure my image id and such were in the database". If you take your old database and upload to your new server, then why should some ids change? :/
What I want to say is that migrating WP from one host to another is just - copy all files, copy database and that's it. If you are changing domain of the site, then you must search/replace database also (but I don't think that's the case here).

How to insert html not from database and not using the iframe?

I wish basically to store my pages or product long descriptions in txt or html files in folders, not in database.
Is there any simple and easy way to do so, instead of iframe which does not work quite well and does not even display the content in the page code so it is not indexed by search engines as it should.
I've read about web components html imports but that seem to be so much complicated and does not really satisfy my needs.
I have not found any plugin to do so, maybe there is one.
I know I wish to make wordpress flat file cms, but maybe there is some new easy way to simply insert pages from anywhere but database might be via shortcode or just an url.
I put it in tags, should say more clear, it is about wordpress on host. As it stores all pages and data in database and I realized bigger database is slower it works. I use caching plugin but I also wish to speed up admin panel and dynamic uncacheble content. My idea is to slim down the database as much as possible and in my woocommerce store most of the data is long description. So the best way would be to inject the long description via shortcode that would take html content from anywhere else but database. I need html, not just some text to insert. This way I would cache these product pages anyway but the database would stay way slimmer and all the dynamic content would go way faster.
In PHP you can use the function file_get_contents, which will display the contents of a file (but not parse it as PHP, which is more secure for obvious reasons).
So you could try something like this if you wanted to account for a page not found message:
function example_get_content($file_url){
if(file_exists($file_url)){
return file_get_contents($file_url);
}
else{
return 'Sorry, this page could not be found'
}
}
And then in your template use
echo example_get_content('http://example.com/my_text_file.txt');

Dnn 2sxc Blog Module sub-directory

I am testing out DNN 8 and am using the blog app and content management from 2sxc (great module, BTW!).
I have the recent blog post listed on a page sub-directory called '/articles'. But I also wanted some of them listed on the home page as well. When I add the app or module to the home page the url is '/home/post/post-title-here' while on the /articles page the urls are '/articles/post/post-title-here'. This creates the illusion that I have two directories with duplicate blog posts (which probably will get me some dings for SEO for duplicating the same content).
How do I get the app to use the common directory '/articles' regardless of where I put the module/app on the site? I've looked at settings all over and don't see anything that pops out at me. Also not sure if this is a DNN setting or a setting specifically to the extension. Finally, I'd like to be able to keep the year/date/month parts of my url as well as they were on the old site. I assume making that change would probably be similar with the solution to my original question. If that's a different fix, then let me know and I'll put it into a new thread. Thanks in advance!
This question is basically about the blog-app. Now if I understand you correctly, your question is "Can I have multiple lists on various pages, but all of them still link to my main details page". The answer is yes, but the exact solution depends a bit on what you need.
So basically there is a setting in the app-settings to define the main page. I believe it's empty by default, so that the blog-app works automatically without you having to configure anything. But AFAIK if you set that, all blog-details-links will use that as the only source.

Wordpress Migration to 1and1.com didn't copy plugin styles

My issue is that the styling that was done to the website is completely missing. The Widgets are also not showing up. When I go into the backend, they are all in place. IF I add a NEW widget, it does show up. So I have something wrong in the .sql file is my guess.
I did notice in my database that I still have a file structure like this: /home/cyndeetg/public_html/mywebsite.com/wp.......
I've seen how on other tutorials to remove the "cyndeetg" part. it's easy to figure out on there, but the way 1and1 does it, it's not clear to me how to find out the new name. The database on the other ones was something like cyndeetg_213 and all you had to do was replace cyndeetg with the new database name in your database, but 1and1.com database names are made completely different and are something like dbw12ed1d214 (no underscore). I think this is what I need to fix but am still not sure. Any thoughts?.
Original Div site
New live site
I did another dump and restore since I learned that the way Wordpress codes where the data is for the plugins data is strange. I used a simple find and replace app called "Velvet Blues Update URLs" just to update the links and the locations of images/documents and all is working perfectly. I hope this helps someone else if they come across this!

Drupal6 option_images module: Uploads but doesn't display Images for certain attribute sets

This is an awfully specific and awfully challenging issue. I know my chances of finding someone else with this problem are slim, but I have to try. I'm stumped.
I'm using Drupal 6, Ubercart, and the Option Images module.
I would like it to switch product images as different attributes are selected.
This works for certain images, but not for others. It seems to be tied to the attribute set, not anything about the image files--I've tried the same image on lots of attribute sets. I've also tried creating different attribute sets to see if I could figure out what aspect of the attributes is making option_images not work. No luck so far.
The Problem
For certain groups of attributes, option images will upload but they do not display on the product page.
Things I've Learned
Even for products that show broken option_images behavior, the images are uploaded. I see them in the database in the files table and on the filesystem.
There is an array on the product page I can see: '$node->option_images'. This array is populated for working product pages, and not populated for product pages that don't show option images.
When I turn on the database debugger, I can see that the database is queried (uc_option_image_load). On the broken pages though, it queries for images for the wrong product. (eg: it looks for sharp cheddar option images when it's on the swiss almond page) These products use different attribute sets.
Screenshots
I found it. The fact that it allows me to upload and preview option_images put me on the wrong path. It is actually a setting which enables and disables attributes for option images.
The setting is here: admin/store/settings/attributes
I think this is a usability bug, since letting me upload images for disabled attributes confused the heck out of me. But anyway. Solved.
Seriously questioning the Drupal way right about now.

Resources