submit_post() function

Need some custom code changes to the phpBB core simple enough that you feel doesn't require an extension? Then post your request here so that community members can provide some assistance.

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Post Reply
Zero Tolerance
Registered User
Posts: 1
Joined: Thu Mar 08, 2018 10:15 am

submit_post() function

Post by Zero Tolerance » Thu Mar 08, 2018 10:38 am

Hello, I make some edits of submit_post() function ("functions_posting.php").
This function returns $url string (URL to new post). But this URL a bit odd, for example:

Code: Select all

./viewtopic.php?f=2&t=9&p=28#p28
  • Why . (dot) at beggining?
  • Why ; (semicolon), not & (ampersand)?
I should replace . (dot) to forum path with domain and replace ; (semicolon) to & (ampersand) symbol.

Maybe some special functions for that? Or I should just use my own:

Code: Select all

$url_ = $url;
$url_ = substr_replace($url_, 'http://mysite.com/community', 0, 1);
$url_ = str_replace(';', '&', $url_);
(sorry for posting in wrong section)

User avatar
Mick
Support Team Member
Support Team Member
Posts: 19986
Joined: Fri Aug 29, 2008 9:49 am
Location: Cardiff

Re: submit_post() function

Post by Mick » Thu Mar 08, 2018 1:15 pm

Zero Tolerance wrote:
Thu Mar 08, 2018 10:38 am
Why . (dot) at beggining?
I believe that is because it's a relative URL path. Such information is available via Google and is standard programming practice not exclusive to phpBB.
"The more connected we get the more alone we become" - Kyle Broflovski

There are no ‘threads’ in phpBB, they are topics.

User avatar
AmigoJack
Registered User
Posts: 5324
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: submit_post() function

Post by AmigoJack » Fri Mar 09, 2018 8:33 am

  • & is an HTML entitiy, as & alone is not allowed in HTML.
  • The leading dot is a relative path, something you should know since understanding your operating system. Every delivered web resource has a base path, and URIs with relative paths are understood likely.
These are essentials - I suggest you stop putting your hands on code and instead start learning and understanding the basics.
The worst thing about censorship is ███████████

Post Reply

Return to “phpBB Custom Coding”

Who is online

Users browsing this forum: Bruce Banner and 2 guests