Jump to content

maxxd

Gurus
  • Posts

    1,698
  • Joined

  • Last visited

  • Days Won

    53

Everything posted by maxxd

  1. @barand - I didn't think of that. Honestly, didn't even know that would work - thanks! I love learning something new.
  2. The problem isn't with the include statement, it's with the SQL query. You've got a comparison in your ORDER BY clause. I think you want SELECT video_categories_id FROM video_categories WHERE video_activated = ? ORDER BY video_categories_id
  3. I can't guarantee it'll make a difference, but it's worth giving it a shot.
  4. Weird. That header is correct. Just for fun, have you tried zipping the files and using the 'Upload Plugin' button?
  5. That could be many things, but we won't know for certain until we get some details from you and see some of the code you've written. There are many, many tutorials out there - some are good, some are not. With the information you've given, we have no way of knowing which kind you're attempting to follow. First thing to come to mind is did you format the comment section at the top the file correctly? Also, the plugin won't show on the dashboard page, you'll have to activate it through the Plugins page first - is that where it's not showing up? Do any other plugins show up on the Plugins page?
  6. If you've got the tables joined, wouldn't you just name the columns in the match? SELECT items.* ,type_1.* FROM items LEFT JOIN type_1 ON items.type_1 = type_1.type_1_id WHERE MATCH(items.item_title, type_1.type_1_name ) AGAINST('$search_query' IN BOOLEAN MODE) ORDER BY items.item_id DESC LIMIT {$limit} OFFSET {$offset} I'm assuming you're validating and sanitizing the variables you're injecting into the query, yes?
  7. I'm with mac_gyver on this - sounds like there's buffering going on somewhere in the system - are you using a CMS or framework, or is this a straight php environment?
  8. The buttons across the top of the post area here are courtesy CKEditor. You would use this or TinyMCE (for instance - there are many, many other options) as the user editor. The resulting user-entered string (html included) is sent to your processing script upon form submission. That's what you would store in the database and present to the user on page load. There's no need for character counts, character positions, or concatenation. Sanitize the string, store it, retrieve it, escape it, and display it. Much simpler.
  9. Your DreamWeaver error message is telling that the site definition is incorrect. Go to Site > Manage Sites, select your site definition in the list, and click the edit button. You'll want to select the 'Servers' panel, select your server in that list, and click the edit button once again. There, update your server location, default path, username, and password, and click 'Test'. This will let you know whether or not the information you entered is valid and able to be used by DW.
  10. What plugin are you using? My point about the image path is that it's being called from the database, assigned to $image_url, then never used - right now, the get_the_post_thumbnail() function call is getting the image path all over again and using it locally to output the image tag.
  11. I have to assume this query is gibberish pseudo-code. The name of your table isn't 'database', and if you've got duplicate values in the ID column, you're using IDs incorrectly. Give us the actual query and we may be able to help you figure out why you're getting a MySQL error.
  12. The function get_the_post_thumbnail() is what outputs the image string. That's what you'll need to change. I do wonder, however, why your script assigns the image path to a variable then never uses it.
  13. You're going to need to do some more work on your media query. Simply 'screen' isn't going to be enough - see here - http://stephen.io/mediaqueries/
  14. While you're following NotionCommotion's advice, look to see if Chrome and Safari are passing the submit button as part of the $_POST data. They probably are, but may not be. If not, you can remove the checks for that and replace it with if($_SERVER['REQUEST_METHOD'] == 'POST'){ @benanamen just beat me to it...
  15. You could run another for() loop, or a foreach() loop. For instance: <div class='links_aggregate'> <?php foreach($pages as $p){ print($p); } ?> </div> Or, if you're gathering the data at the point in the page where you need to output the links, simply print() or echo() them there instead of assigning them to an array. Heck, if you don't care about source readability, you could simply output an implode() on the array echo implode(' ', $pages); That last one hasn't been tested and is the product of a couple beers, so take it with a grain of salt.
  16. I really don't mean to sound mean, but it sounds as though yes - you are totally in over your head. You don't trust the security of the established CMSs out there, so you decide to write one yourself after one course in PHP/MySQL? It doesn't matter what the users you're targeting are capable of, the site will be available on the Internet. Not just your target audience will be able to access it, even if it's password protected. In this case (and believe me, I never thought I'd be saying this) you might be better off using WordPress. Take a few more courses in PHP and MySQL, put together some sites on your local machine, ask some questions, and continue to learn, and I certainly hope you'll build a WP killer; but from what it seems like you're asking I'm not even sure you've got the basics of how and why to use a database under your belt yet, let alone how to protect not only the server upon which you're hosting the site, but the users that will possibly be using that site.
  17. 'page' is defined as "The page number to show". 'per_page' is defined as "Number of items to show on each page. Max 50.". There's also an 'offset' key, which according to the documentation you shouldn't supply. The assumption here would be that 'page' and 'per_page' work together for paginated search results; for instance, to show videos 51-101 of user 1577007's playlist, you would call to 'https://api.vimeo.com/users/1577007/feed?page=2&per_page=50'. Of course, when you do that in the playground, you're told that "The user is not allowed to perform that action." Which means there must be more to it - perhaps you need an API key, or perhaps you can't just pull a random stranger's playlist. If you select 'likes' on the same user, though, you do in fact get some data back, so I'm thinking you may need the user's specific permission to grab his or her feed contents, but that same user's likes are public. Regardless, your best bet is to start by reading the documentation and experimenting with the playground API they've set up.
  18. One course on PHP isn't going to cut it for you in this situation. As you've already seen, the CMS handles hashing the passwords, so let it. It probably handles assigning user roles as well. Let it do that, too. It's a content management system specifically so that you don't have to manage the content directly. Let it do it's job, and your hair will stay where it's meant to be a lot longer than otherwise.
  19. I never trust my brain before my third cup of coffee...
  20. Try using the playground they have set up here - it looks like your endpoint call is set up incorrectly. There may be something more egregious that I'm missing as I'm not terribly familiar with the Vimeo API, but I'd start at the malformed request.
  21. Why would you replace the source attribute of an image with your telephone number? It sounds like you're looking for the anchor tag, in which case you're looking at the wrong code. Look for where the template outputs or assigns to a variable "<a href='https://domainnamehere.co.uk'>" - that's the line you're wanting to change. Although, looking at the little bit of code you've supplied, I'm not exactly sure how your theme is handling this. It's outputting both mobile and desktop versions of the image, and I assume using CSS media queries to display or hide the appropriate image. Check to see if the theme developers have added a filter at the point where the home link's href attribute is output in the template file (I assume you're in header.php).
  22. Right now your code is using the default PHP mail() function. Try wp_mail() - it uses PHPMailer behind the scenes, which is better than the native function.
  23. Well that made things entirely too simple. Thank you. Going to sit in a corner and cry for a bit about the hours I wasted trying to 'debug' this.
  24. @requinix - thank you for the analysis! What I'm doing with the script is basically replacing form elements with individual series of divs that act as those form elements. So, a checkbox (in this case) is replaced with a simple div and an onclick() function that toggles the underlying (and hidden) checkbox state according to the display state of the div. Display is controlled by adding and removing classes (checked and unchecked), while the checkbox state is controlled via the .checked property of the checkbox in question. The two are linked via a JS-injected data-attribute on the div that contains the ID of the corresponding checkbox. Now that the word 'checkbox' has little meaning any more, I hope that makes sense. From what I'm seeing in your console output, it looks like I need to add a check to see if the current form element is an HTMLCollection, and if so, iterate a loop through that. So in essence, every browser except Edge and IE are flattening a multi-dimensional array of form elements. Am I reading that correctly (I've only had one cup of coffee, so that's a genuine question)? Or is it as simple as using a for..of loop? Off to try... Also, if I'm passing in a specific local form object, how does that create a potential XSS vulnerability? And again, thank you very much!
  25. OK - given a little experimenting, it appears your suggestion will work Jacques1 - much thanks for the suggestion. Now I just need to figure out how to add the explicit indexes to the plugin output. woot.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.