Todd is very gentle to reply me but speaks in a too technical language for my computing knowledge...
@x00: that's the point. I would like to open the phpbb_posts in a text editor and replace all the internal URLs written with the phpBB2 scheme with the ones written according the Vanilla2 scheme. Unfortunately the IDs of the posts are different and I should replace all of them manually (they are hundreds)...
So I though I could tell phpMySql to search& replace for me. But if the editor is a better option I'm ready to use it!
Unfortunately thay are weeks that this thing is stopping me from moving
Check for SciTE but is for Windows/Linux and guess what I use... Hope skEdit can replace with regular expressions too... The only think is that, after the search&replace method probably the file will be huge and phpMySql would complain... For this reason I would preferred a function to run into the database directly...
Anyway MANY THANKS for all the help: I'll post again if I manage...
No problem when I download the DB. When I try to upload, it's says that is too huge to manage. So I need to use a script to join many parts of it uploaded one after another.
public function RemoveBBCodeUIDs($Value, $Field, $Row) { $UID = $Row['bbcode_uid']; $Result = str_replace(':'.$UID, '', $Value); $Result = preg_replace('`viewtopic\.php\?f=\d+\&topic=\(\d+\)`', 'discussion/\1/x/p1', $Result); // Other replaces here.
return $Result; }
That's all the help I'm going to give you on this. If your not a technical person you're going to get yourself into a lot of trouble copy and pasting code snippets without any understanding of the underlying concepts.
Many thanks, Todd. I'll try it into phpMySql and, hopefully, will move my community to Vanilla. I'm not a technical person but I can install and migrate the forum by myself. The URLs problem was the only one left. Anyway, I understand your advice. Thanks again!
@Todd: I've searched in the vanilla2export.php the right place to add the function you provided but I've found that part of the code is a little different:
original file: return str_replace(':'.$UID, '', $Value);
@Todd Obviously I've changed the phpBB related part of the Vanilla Porter code. Have you any other solution to suggest? Very strange that the function above didn't provide any change.
I'm going to put a stop to this thread from my point of view. You are trying to do a real nit-picky amount of customization that others have suggested you don't do and yet you still want to do it, even though you don't seem to have the basic programming skills required do this.
I'm trying not to come off as harsh, but you can't expect to just blindly copy and paste code into an application and expect it to work without some basic debugging. You have to do things like isolate your functions with test data. Put echos in the code. Read the php documentation on functions, etc.
Open source is all about giving you the freedom to modify code. It's not about us modifying your code for you.
Answers
@x00: that's the point. I would like to open the phpbb_posts in a text editor and replace all the internal URLs written with the phpBB2 scheme with the ones written according the Vanilla2 scheme. Unfortunately the IDs of the posts are different and I should replace all of them manually (they are hundreds)...
So I though I could tell phpMySql to search& replace for me. But if the editor is a better option I'm ready to use it!
Unfortunately thay are weeks that this thing is stopping me from moving
like so
Find What ->
viewtopic\.php\?f=\d+\&topic=\(\d+\)
Replace With ->
discussion/\1/x/p1
with regular expression, wrap around and backslashes checked.
routes are not that slow. they are done when the person visits that link.
grep is your friend.
Hope skEdit can replace with regular expressions too...
The only think is that, after the search&replace method probably the file will be huge and phpMySql would complain...
For this reason I would preferred a function to run into the database directly...
Anyway MANY THANKS for all the help: I'll post again if I manage...
most good editors do. Just need to know the nuances. scite uses posix mode
why would the file be huge? you are reducing the content.
How about using vim?
grep is your friend.
When I try to upload, it's says that is too huge to manage.
So I need to use a script to join many parts of it uploaded one after another.
http://macvim.org/OSX/index.php
grep is your friend.
I'll try it into phpMySql and, hopefully, will move my community to Vanilla.
I'm not a technical person but I can install and migrate the forum by myself. The URLs problem was the only one left. Anyway, I understand your advice.
Thanks again!
Or must I apply it after the migration?
Many thanks...
BTW: why there is the ability to delete messages posted within a certain period of time?
Useful to delete my previous post, for example.
There are 30 minutes to Edit the message: it would be nice to add the possibility to delete a post enter 5 minutes, for example.
public function RemoveBBCodeUIDs($Value, $Field, $Row) { $UID = $Row['bbcode_uid']; $Result = str_replace(':'.$UID, '', $Value); $Result = preg_replace('`viewtopic\.php\?f=\d+\&topic=\(\d+\)`', 'discussion/\1/x/p1', $Result); return str_replace(':'.$UID, '', $Value); return $Result; }
public function RemoveBBCodeUIDs($Value, $Field, $Row) { $UID = $Row['bbcode_uid']; $Result = str_replace(':'.$UID, '', $Value); $Result = preg_replace('`viewtopic\.php\?f=\d+\&topic=\(\d+\)`', 'discussion/\1/x/p1', $Result); return $Result; }
@Todd: I've searched in the vanilla2export.php the right place to add the function you provided but I've found that part of the code is a little different:
original file:
return str_replace(':'.$UID, '', $Value);
modded one:
$Result = str_replace(':'.$UID, '', $Value);
Hope you'll find the time for me: this wall stop me from junping to the other side... :P
public function RemoveBBCodeUIDs($Value, $Field, $Row) { $UID = $Row['bbcode_uid']; $Result = str_replace(':'.$UID, '', $Value); $Result = preg_replace('`viewtopic\.php\?f=\d+\&topic=\(\d+\)`', 'discussion/\1/x/p1', $Result); return str_replace(':'.$UID, '', $Value); return $Result; } }
...but it didn't work
The URLs in the posts are still the same pointing to old phpbb internal structure.
Have you any other solution to suggest?
Very strange that the function above didn't provide any change.
I'm trying not to come off as harsh, but you can't expect to just blindly copy and paste code into an application and expect it to work without some basic debugging. You have to do things like isolate your functions with test data. Put echos in the code. Read the php documentation on functions, etc.
Open source is all about giving you the freedom to modify code. It's not about us modifying your code for you.