Fancy url instead of /86

eric redegeld Posted in Component Development 11 months ago

My site is growing and so also the user wishes.

one main is the returned question about the lak off Fancy url.

now we got this
https://nlsociaal.nl/group/1180/

but is look nicer with this https://nlsociaal.nl/group/Prive_groep_voorbeeld

long time ago there was an thread about groups, but still no solution.
for the Group, forum and business pages would this be an great solution.
Meta eat your hart out

Replies
Dutch Eric redegeld Replied 10 months ago

would you share this with me?
no got it working with database alteration(inspired by hashtag)
But wanted to have without DB

German Michael Zülsdorff Replied 10 months ago

yup, made 2 pull requests with my changes included

Dutch Eric redegeld Replied 10 months ago

well, for now i am setting up test place with the free core

Dutch Eric redegeld Replied 10 months ago

Thank you, great feedbac.

can you point me to where to find
"
Type of 'group' is NOT working. And if you have a look into the OssnEntities class (as recommended by me a day ago) you see: There is indeed no entity of type 'group' by default. And that's why your call fails in line 81

if(!empty($this->owner_guid) && in_array($this->type, $this->entity_types)) {
"
You mentioned.
you can email me [email protected]

German Michael Zülsdorff Replied 10 months ago

"Anyone using OSSN 8.1 able to confirm if ossn_add_entity() works for type group?"

Type of 'group' is NOT working. And if you have a look into the OssnEntities class (as recommended by me a day ago) you see: There is indeed no entity of type 'group' by default. And that's why your call fails in line 81

if(!empty($this->owner_guid) && in_array($this->type, $this->entity_types)) {

Okay, so what can we do if we don't know which type to use? A good idea is starting phpmyadmin, display ossn_entities in reverse order and create a new group. And actually, a new record gets created reflecting the membership. And voila: the type is 'object' (one of the allowed default types listed in the class file btw.)

After changing your helper code accordingly, the slugname record got created successfully

![enter image description here][ATTACHMENT:7555]
enter image description here

Almost working now. We just need to fetch the entities owner_guid instead of guid in order to redirect correctly, because the groups guid is stored this way.
Yep, and now g/music is redirecting correctly to group/523
Fine, Eric!
[ATTACHMENT:7555]: https://www.opensource-socialnetwork.org/photoattachment/7555/gsentity.jpg

Dutch Eric redegeld Replied 10 months ago

wow, okay again with an database tabel

https://shadow.nlsociaal.nl/g/ditwerkt
for now got it working based on example module hashtag with the enable.php

Now firmly testing

Dutch Eric redegeld Replied 10 months ago

"Anyone using OSSN 8.1 able to confirm if ossn_add_entity() works for type group?"

Dutch Eric redegeld Replied 10 months ago

same for me
;-)
okay, another light in the dark, version

German Michael Zülsdorff Replied 10 months ago

Promised Eric, I'll continue to keep my components available for free... ;)

As for the SlugRouter: Currently I have no time to dig into that.
Just this one: Before calling a function like ossn_add_metadata() make sure the function exists and what kind of parameters need to be passed.
At least my free Ossn 8.1 doesn't include any ossn_add_metadata()

Dutch Eric redegeld Replied 10 months ago

@zetman Not everything needs to be paid. The real power of open source lies in building something meaningful together.
Contribute, improve, and share – help make this better:
👉 https://github.com/compie67/ossn-GroupSlugRouter

Premium Version

Due to the many requests in the past for additonal features and components we have decided to develope a premium version. Features like Hashtags, Videos, Polls, Events, Stories, Link Preview, etc included in it.

$199 (Life Time)
Learn More

Other Questions