Resource icon

Post Content Find / Replace 1.0.0

No permission to download
Sure thing and you are welcome.

Quick Find:
Code:
domain.com

Regular expression:
Code:
#(\[(url)(?:='|])?[^\.]+www\.domain\.com)/[^/]+/([^']+)-([0-9]+)\.html('].*?(?!\[/\2]?).\[/\2]|\[/\2])#siu

Replacement String:
Code:
\1/forum/konu/\3.\4\5
 
Last edited:
Replacement String should be: ?
Code:
\1/forum/konu/\3.\4\5

Looks like you nailed them both here. I'll break down your regex later when I have the time.

Great Job!
 
@maxicep Use the regex from EQnoble to replace both. But use the replacement I typed above.

As always, test first before saving. You can also narrow your search in the Quick find.
 
@Burp @maxicep @Arno Nühm
gdfgh.webp
Adding some options to the Post Replacement addon

This addon patch adds a few things to the base addon

Adds two quick find options (count and offset thanks to Jake Bunce for his edit here)
Adds one replacement option (edit silently)
Adds 5 phrases​


Install the patch as an addon from the xml file within this zip then complete the following steps to modify a php file from the original addon.

First copy the file at your.xenforo.com/library/PostReplace/ControllerAdmin/PostReplace.php

Once the file is open in a real editor like notepad++ complete the following steps:



Starting on line (19) find and highlight all of the following:
PHP:
            'page' => XenForo_Input::UINT,
        ));

        $posts = $this->_getPRPostModel()->getPostsContaining($input['find']);
replace with the following:
PHP:
            'page' => XenForo_Input::UINT,
            'silent' => XenForo_Input::UINT,
            'limit' => XenForo_Input::UINT,
            'offset' => XenForo_Input::UINT
        ));
    
        $posts = $this->_getPRPostModel()->getPostsContaining($input['find'], array(
            'limit' => $input['limit'],
            'offset' => $input['offset']
        ));

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Scroll down to what is now line (44) then find and highlight all of the following:
PHP:
                    $dw->setExistingData($post, true);

                    $dw->set('message', $message);
replace with the following:
PHP:
                    $dw->setExistingData($post, true);
                    if($input['silent']) { $dw->set('last_edit_date', 0);  }
                    $dw->set('message', $message);


Save that file and upload to your server​
Enjoy

 
Last edited:
This must be very simple, but can someone please tell me how to remove a directory level from a url

e.g I want to remove /community from all links

example.com/community/xxxxxx becomes example.com/xxxxxx

Thanks and merry Christmas
 
Something like this should work, try it out without saving.

Quick Find:
Code:
example.com/community

Regular expression:
Code:
#(example\.com/)(community/)([^\s]+)?#siu

Replacement String:
Code:
\1\3
 
Thanks guys,
I was able to convert a good deal of the 94,000 vids that were on the site.

Some ended up being dead links or what have you, but it worked well enough where we move on to the next item of business.

The comments here helped a ton also in order to maximize conversion/extraction from old.

Much appreciated!!
 
Congrats.

I have done and am doing some work in that field right now (creating a disp. POS system ATM) and have a few themes mocked up as well that can be scraped out fully so if the next line of business is a heady style feel free to contact me as I have interest in putting one out there.

I also have some homebrew tools for things like removing dead links in posts if that is something you want fixed as well (if you want a custom style I will handle the dead link fixing on the strength).
 
You install the addon, find patterns you wish to change, form an expression to match those patterns, then provide a replacement string to change all stuff that matched your pattern.
 
You install the addon, find patterns you wish to change, form an expression to match those patterns, then provide a replacement string to change all stuff that matched your pattern.

Should have been more clear, I haven't been having any luck with the regex or the replacement strings ;)

Would you tell me what I need to input?
 
Hey up EQ,

that was for my other forum goldismoney2.com, and it worked. The other on my av is a startup much as you are doing with the POS kit. Good luck, as it is needed out there. Went to Co, and it was the wild wild west with legalization.
 
Should have been more clear, I haven't been having any luck with the regex or the replacement strings ;)

Would you tell me what I need to input?
I would if I could but I can't so I won't (because at the moment I still don't know what you need help with:sneaky:), but yeah I'll help just post up in this format to ask for help to help everything along.


Link to a post on your board (optional):

2 example strings in posts as they exist now
[code]
example strings from post (bbcode editor view of text)
[/code]

2 example strings as they should be changed to in a post
[code]
example strings the way you need them to be in posts
[/code]





Hey up EQ,

that was for my other forum goldismoney2.com, and it worked. The other on my av is a startup much as you are doing with the POS kit. Good luck, as it is needed out there. Went to Co, and it was the wild wild west with legalization.

Awesome glad it worked out for you.

I am actually trying to finish it up and market it to the dispensaries out here which is needed as the system works a bit differently internally than states like Co. and part of the regulations here make most of the existing POS systems pretty much worthless as far as compliance and ease of use is concerned.

It's not so much of a startup because I have no interest in starting a company for this (unless I have to) or becoming famous, I just want a POS system that fits my state and if they (one of the dispensaries) are smart enough to see the value of what I made I will sell it to them and any other medical dispensary in the country that wants it which is about the best way I can help my fellow Americans seeing that they will NEVER make me the president or anything.:ROFLMAO: Besides if it was a startup, I would have already secured money and been paying myself a salary while I am developing it.

Just got back from Co myself not too long ago (where I was writing code in my head while debugging the hotel I was in letting them know about errors in the fire escape on the inside of the suite door which indicated the wrong room and explained to them how things like that are a lawsuit waiting to happen and got a free filet mignon for my time spent and some friendly employees put me on to some clutch places to partake so... worth+ ) and yeah it is the Wild West literally when compared to the system in my state. I almost moved there like 2 months ago but the house I was really into sold in like a day while I was on the way there...the market is ridiculous there right now.

Both systems are needed though...it needs to be shown that we need to start making tax dollars off of it instead of spending money criminalizing and thus creating a dark un-taxed market that no one but criminals really benefit from (in Cali criminals were donating campaign money to people who want to make it completely illegal and when the cops and criminals agree you need to reevaluate the situation) and they need to see once legalized how many people actually partake and thus the scope of what they are throwing away at the moment.

Colorado shows how much good can come from the move (80 million in taxes is no joke and that is even without heavy enforcement) and a state like mine can show that legalizing it (although only medically) actually makes the product safer (everything is lab tested for contaminants, DNA cataloged and terpene profiled), the acquisition of it safer, allows for networking and communication with other people who know the deal which leads to a more educated consumer who is being informed by someone who doesn't benefit from their neighbor not knowing the truth.

/end OT
 
I can't figure this out.

I have posts like this:
Code:
https://www.youtube.com/watch?v=mG92yuovD6g
http://www.youtube.com/watch?v=mG92yuovD6g

Which I need to change to

Code:
[MEDIA=youtube]mG92yuovD6g[[/MEDIA]

Any help will be greatly appreciated.

Thank you.
 
Back
Top Bottom