The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
VBSEO - I want to get the full attachment URL (vbseo friendly)
Hello all!
We have vbseo on a vB3 board. The thing I want to achieve is very simple, but I don't have do it. I want on a php script to convert an attachment url into vbseo friendly url. The url is something like this: $vbulletin->options['bburl'] . "/attachment.php?attachmentid=$attach[attachmentid]&d=$attach[dateline] (full attachment url / not thumb=1) I tried this but we receive server error on cloudflare: PHP Code:
PHP Code:
Finally to notice that this is returning "" (empty): PHP Code:
|
#2
|
||||
|
||||
VBSEO is bug ridden and has many security holes. Unless you have custom patched it, it is highly recommended to remove it. There are a zillion posts on this...
|
#3
|
|||
|
|||
I think your best bet would be to try and make it work with vbseo_output_handler, since you've got that partially working already.
|
Благодарность от: | ||
TheLastSuperman |
#4
|
||||
|
||||
I agree with Hostboard - I don't recommend using vBSEO at all, so proceed and use at your own risk;
To convert an attachment URL into a vBSEO-friendly URL in vBulletin, you are on the right track by trying to utilize vBSEO's built-in functions to rewrite the URLs. However, it appears that you are encountering issues with Cloudflare errors and empty returns. Let's go through some steps that may help resolve these issues: - Debug the Cloudflare Error: Cloudflare errors typically indicate some problem with the server configuration or the way the request is being handled. Check your Cloudflare settings to ensure that you are not hitting a security rule that's causing the server error. Look at the server logs to see if there's more information about the error. It could be that the make_crawlable function or some other part of your script is triggering a rule on Cloudflare's side. - Correct Use of vbseo_output_handler: It's important to ensure that the function vbseo_output_handler is designed to handle individual URLs, and not an entire array of URLs at once. If it's designed for individual use, you'll need to call it inside the loop for each attachment URL. If the function works for the first URL but not subsequent ones, it might be a scoping issue or a problem with the way the loop is structured. Ensure that $temp is being properly reset at each iteration of the loop. - Investigate vbseo_attachment_url Function: If vbseo_attachment_url($attach['attachmentid']) is returning empty, it could be due to several reasons. The function might not be able to retrieve the necessary data from the database, or it might require additional parameters. Check the definition of the vbseo_attachment_url function to ensure that you are using it correctly. There might be required parameters that you are missing or additional setup needed. - Check vBSEO Documentation: Refer to the vBSEO documentation for the correct usage of functions like make_crawlable and vbseo_output_handler. There might be specific instructions or prerequisites that you're overlooking. *Finding official vBSEO documentation can be challenging since the official site is closed. However, some resources may still exist on the Internet Archive. You can search for vBSEO materials using the following link: Internet Archive Search for vBSEO using this link: https://archive.org/search.php?query...%3A%22VBSEO%22 - Ensure Proper Variable Interpolation: Check that your PHP code is interpolating variables correctly in the string. Sometimes concatenation issues can cause the URL to be malformed, leading to errors. - Review Server Configuration: Since you're encountering server errors, it's also a good idea to review your PHP and server configurations. Ensure that the PHP version you are using is compatible with your vBulletin and vBSEO versions. - Test with Error Reporting: Enable error reporting in PHP temporarily to get more detailed errors. This can provide clues as to what is going wrong. Remember to turn this off in a production environment. Here's a very basic example of how your loop should probably look (assuming vbseo_output_handler is the correct function to use): Code:
foreach ($attachments as $attach) { $temp = "<a href=\"" . $vbulletin->options['bburl'] . "/attachment.php?attachmentid={$attach['attachmentid']}&d={$attach['dateline']}\"></a>"; $temp = vbseo_output_handler($temp, false); // Now $temp should contain the individual vBSEO-friendly URL $attach['full_res_src'] = $temp; // ... Do something with $attach['full_res_src'] } |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|