Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted October 4, 20231 yr In my previous(3.x) version of invision community setup. There are some pages in the menu, which have custom URL. I am not able to find which pages(php or html) it is pointing too. Can someone help ?
October 4, 20231 yr Not really sure what you're asking here. Could you clarify? With an example maybe.
October 4, 20231 yr Are you looking for pages on your filesystem there? If so, it may well be that they are not there, and instead in IP.Content within your admin CP. Not sure of the location off hand as I havent see that for quite a long while myself
October 5, 20231 yr Author 20 hours ago, teraßyte said: Not really sure what you're asking here. Could you clarify? With an example maybe. In version 3.6 Under Pages, i can create new pages using html tag and php tags. In version 4.7 When i am trying to add content for a page in PHP tag (<?php ). It starts throeing error ParseError: syntax error, unexpected string content "", expecting "-" or identifier or variable or number in system/Theme/Theme.php(4628) : eval()'d code:17 Stack trace: applications/cms/sources/Pages/Page.php(1278): IPS\_Theme::runProcessFunction('\tfunction conte...', 'content_pages_9') #1/applications/cms/sources/Pages/Page.php(2308): IPS\cms\Pages\_Page->getHtmlContent() #2 /applications/cms/modules/front/pages/page.php(116): IPS\cms\Pages\_Page->output() #3 /applications/cms/modules/front/pages/page.php(43): IPS\cms\modules\front\pages\_page->view() #4/system/Dispatcher/Controller.php(118): IPS\cms\modules\front\pages\_page->manage() #5/applications/cms/modules/front/pages/page.php(33): IPS\Dispatcher\_Controller->execute() #6/system/Dispatcher/Dispatcher.php(153): IPS\cms\modules\front\pages\_page->execute() #7 /index.php(13): IPS\_Dispatcher->run() #8 {main} 2 minutes ago, Jyoti Rani said: In version 3.6 Under Pages, i can create new pages using html tag and php tags. In version 4.7 When i am trying to add content for a page in PHP tag (<?php ). It starts throeing error ParseError: syntax error, unexpected string content "", expecting "-" or identifier or variable or number in system/Theme/Theme.php(4628) : eval()'d code:17 Stack trace: applications/cms/sources/Pages/Page.php(1278): IPS\_Theme::runProcessFunction('\tfunction conte...', 'content_pages_9') #1/applications/cms/sources/Pages/Page.php(2308): IPS\cms\Pages\_Page->getHtmlContent() #2 /applications/cms/modules/front/pages/page.php(116): IPS\cms\Pages\_Page->output() #3 /applications/cms/modules/front/pages/page.php(43): IPS\cms\modules\front\pages\_page->view() #4/system/Dispatcher/Controller.php(118): IPS\cms\modules\front\pages\_page->manage() #5/applications/cms/modules/front/pages/page.php(33): IPS\Dispatcher\_Controller->execute() #6/system/Dispatcher/Dispatcher.php(153): IPS\cms\modules\front\pages\_page->execute() #7 /index.php(13): IPS\_Dispatcher->run() #8 {main} in Theme.php line of code are if( eval( $function ) === FALSE ) { /* Throw exception for PHP 5 */ throw new \InvalidArgumentException; }
October 5, 20231 yr 4.7 doesn't support adding PHP code directly to a page. You need to create a PHP Block and then add it to the page itself.
October 6, 20231 yr Author 22 hours ago, teraßyte said: 4.7 doesn't support adding PHP code directly to a page. You need to create a PHP Block and then add it to the page itself. Can i include another php files in blocks?
October 6, 20231 yr Author 5 minutes ago, Marc Stridgen said: You should be able to I would think getting the attached error. when i am adding below code in the block code require_once("xx/xx/xx/front_constants.php");
October 6, 20231 yr Author 4 minutes ago, Jyoti Rani said: getting the attached error. when i am adding below code in the block code require_once("xx/xx/xx/front_constants.php"); Can i call functions from another files in the block file?
October 6, 20231 yr 18 minutes ago, Jyoti Rani said: getting the attached error. when i am adding below code in the block code require_once("xx/xx/xx/front_constants.php"); You would need to ensure you are using the correct location and that the file is readable there. 13 minutes ago, Jyoti Rani said: Can i call functions from another files in the block file? Im not sure what you mean here, as this appears to be essentially the same question
October 6, 20231 yr Author 28 minutes ago, Marc Stridgen said: You would need to ensure you are using the correct location and that the file is readable there. Im not sure what you mean here, as this appears to be essentially the same question Issue is this when i m saving in admin section its parsing the content and loading the next line of code. Because the files are on the same location. But when i go to the frontend of the site to view the page The url of the browser gets changed and its not able to find the file.
October 6, 20231 yr Are you using a relative path to load the file? Try using a full one instead. You can find the full path of the suite files in the Support page.
October 6, 20231 yr Author 12 minutes ago, teraßyte said: Are you using a relative path to load the file? Try using a full one instead. You can find the full path of the suite files in the Support page. How i can get CP_DIRECTORY variable in block php code?
October 6, 20231 yr If your front_constants.php file is inside the admin directory (CP_DIRECTORY) you can use this: require_once( \IPS\ROOT_PATH . '/' . \IPS\CP_DIRECTORY . '/front_constants.php' ); Instead, if it is in the root folder, where conf_global.php is located, use this: require_once( \IPS\ROOT_PATH . '/front_constants.php' ); Edited October 6, 20231 yr by teraßyte