HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Please upgrade here. These earlier versions are no longer being updated and have security issues.

how to remove url after discussion number

sir,
I want to remove url after discussion number
like
http://forum/discussion/563/‎daughter-of-mufaasir-azam-e-hind-sister-of-huzur-taajush-shariah-has-just-passed-away#latest
to
http://forum/discussion/563/
how to remove url after discussion number
please help me...

Comments

  • R_JR_J Ex-Fanboy Munich Admin

    Create a file /plugins/noDiscussionName/class.nodiscussionname.plugin.php with the following content:

    <?php
    
    $PluginInfo['noDiscussionName'] = [
        'Name' => 'No Discussion Name',
        'Description' => 'Prevent the discussion name from being shown in links',
        'Version' => '0.1',
        'License' => 'MIT'
    ];
    
    class noDiscussionNamePlugin extends Gdn_Plugin {
    }
    if (!function_exists('discussionUrl')) {
        function discussionUrl($Discussion, $Page = '', $WithDomain = true) {
            $Discussion = (object)$Discussion;
            $Result = '/discussion/'.$Discussion->DiscussionID.'/';
            if ($Page) {
                if ($Page > 1 || Gdn::session()->UserID) {
                    $Result .= 'p'.$Page;
                }
            }
            return url($Result, $WithDomain);
        }
    }
    
    

    Enable that plugin and see if it is enough - I'm not sure about that.

    mdrajaskSwennet
  • thank you very much sir working fine

Sign In or Register to comment.