News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Removing quote time stamp and link to topic via phpmyadmin.

Started by azasmith, June 20, 2014, 07:04:46 AM

Previous topic - Next topic

azasmith

Good morning, I am trying to remove everything from the quote bbcode, except the quote=username portion, I know this is probably a pain, as time codes and topics/post numbers aren't exactly universal, now, I know this would be possible through the use of replace in a php script and wild cards, but thought I'd ask if it was possible through the use of phpmyadmin.

Thanks.

Also in before "why would you want to?" Short answer, I'm building a "what date did this event happen" based quiz forum. (Proof of concept, but seems easy enough.)

kat

I would think that toying with dates, in the database, is likely to cause... er... phun.

I would imagine that changing the data for the date, there, is likely to cause the date to change everywhere, with all the OMG! that that's likely to cause.

Of course, someone with more knowledge of databases might come in, later, and prove me wrong. I hope they do.

azasmith

Thanks k@, I'm not strictly removing the function that calculates the time on a post, just when it enters that into the bbcode body of smf.messages.

Quote from: authorfortunately quotes work with none of the topic information or time stamps!
so it shouldn't break anything from what I can work out. Ha

kat

To be honest, I wouldn't have a clue where to even start, with trying to hack that about. :(

As I said, I hope someone will prove me wrong and show you how it can be done. I wouldn't hold your breath, though. ;)

margarett

It can, but I'm not sure if via phpmyadmin...

Here's the catch: a complete quote is like:

[quote author=K@ link=topic=524118.msg3710807#msg3710807 date=1403295490]

The link is built with topic=xxxx, and so on and so on.

I think you would need to fetch every post body in php, do some replacement stuff and return the modified body to the database.
In php it's certainly doable, although with some workload attached...
Directly in the database, I don't know the text replace functions good enough...
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

kat

That's for sure. It's this wanting to do it by hacking the db that has my buttocks aquiver.

I'm sure that'll cause a LOT of grief...

azasmith

Quote from: margarett on June 20, 2014, 04:25:05 PM
It can, but I'm not sure if via phpmyadmin...

Here's the catch: a complete quote is like:

[quote author=K@ link=topic=524118.msg3710807#msg3710807 date=1403295490]

The link is built with topic=xxxx, and so on and so on.

I think you would need to fetch every post body in php, do some replacement stuff and return the modified body to the database.
In php it's certainly doable, although with some workload attached...
Directly in the database, I don't know the text replace functions good enough...

This was my thinking, I know text replace doesn't allow the use of wildcards, but update does, however I'm not entirely sure just how far they allow you to go.

margarett

I'm not sure if you can use text replace via phpmyadmin... I'd say you either need regexp or manually search by text characters, positions and so on.
Both of which are php....
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

azasmith

Looks like I'll be doing it in php then, thanking you for the assistance on this.  ;D

margarett

Let us know if you need further help ;)
And if you fix it, maybe share the code with us? ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Antechinus

I've hacked the presentation of the quote header before. It's not hard to do if you're proficient with basic PHP syntax (Subs.php BBC arrays, of course). You can add and remove anything you like there.

azasmith

Hey antechinus, yeah newly created posts was relatively easy, but existing posts is something else.  :laugh:

Antechinus

Ah. Yes a bit of a nusiance there.

Although TBH, I'd be lazy and ignore old posts.

Advertisement: