We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1828
    • 137 Posts
    I’m seeing the following error:

    « MODx Parse Error »
    MODx encountered the following error while attempting to parse the requested resource:
    « PHP Parse Error »

    PHP error debug
    Error: include_once(assets/snippets/wayfinder/wayfinder.inc.php) [function.include-once]: failed to open stream: No such file or directory
    Error type/ Nr.: Warning - 2
    File: /home/benson/public_html/manager/includes/document.parser.class.inc.php(705) : eval()’d code
    Line: 28


    Some sort of path problem?

    I have the server path set as follows in fck_cmscontent.php:

    include_once(’/home/benson/public_html/modxapi.php’);

    And I have wayfinder installed and working on this site.

    Any ideas?

    Thanks,
    Anton
      • 16429
      • 254 Posts
      It works for me, but it doesn’t shows the tree so I can’t select the page...
        kudo
        www.kudolink.com - webdesign (surprised?)

        [img]http://www.kudolink.com/kudolinkcom.png[/img] [sup]proudly uses[/sup] [img]http://www.kudolink.com/modx.png[/img]
        • 37550 ☆ A M B ☆
        • 711 Posts
        Hi Kudolink,

        Last time I seen this it was because certain characters in the page title was causing the javascript to crash out, last time it was ’ and ` which I fixed with your screen shot indicating Italian could you let me know if your using any special characters and I will look at getting them to work.

        Will reply to everyone else soon, been quite busy recently with other projects.

        Thanks

        Aaron
          http://www.onesmarthost.co.uk
          UK MODX Hosting with love.
          • 16429
          • 254 Posts
          Yes, some "é"s and "à"s and other accented characters. Plus some single quote.
            kudo
            www.kudolink.com - webdesign (surprised?)

            [img]http://www.kudolink.com/kudolinkcom.png[/img] [sup]proudly uses[/sup] [img]http://www.kudolink.com/modx.png[/img]
            • 37550 ☆ A M B ☆
            • 711 Posts
            Thanks for getting back to me I have tried to replicate the problem on my modx install but it works for me, would it be possible for you to email me a screen shot or post one of your tree menu in modx so I can get an idea to what your page titles are.

            Thanks
              http://www.onesmarthost.co.uk
              UK MODX Hosting with love.
              • 16429
              • 254 Posts
              Sorry: I didn’t recognize your request!

              Here the screenshot whit some char. I’ve underlined some.
                kudo
                www.kudolink.com - webdesign (surprised?)

                [img]http://www.kudolink.com/kudolinkcom.png[/img] [sup]proudly uses[/sup] [img]http://www.kudolink.com/modx.png[/img]
                • 26104
                • 36 Posts
                Here’s an updated version of the file fck_cmscontent.php which generates completely dynamic URLS. So if you change from/to SEF or change your site’s location the links remain working by using the [~id~] tag.

                I think this feature could be easily integrated into next versions of ModX smiley

                fck_cmscontent.php
                <?php	
                	require_once('../../../../../../modxapi.php'); // <---- Change the path for your server
                	
                		
                	// *********************************************************************************
                	//
                	// Modded By: Aaron Wardle ([email protected]) 
                	// Date:      4th August 2006
                	// Website:   http://www.spcs.eu
                	// Version:   0.2
                	// 
                	// Info: 	  CMSContent allows you to add internal modx links into your documents, 
                	// 			  simply click the toolbar button and a dialog will popup showing a treeview of your
                	// 			  site documents. 
                	//		
                	//			  Currently checks if FURLS are enabled, and adds the preifx / suffix as defined in modx settings
                	//			  If FURLS are disabled it will add links like index.php?id=1
                	//
                	// Credits:   CMSContent was Originally created by woudloper for CMS Made Simple.
                	//            Geir Landr - For the great javascript tree http://www.destroydrop.com/javascript/tree/
                	//
                	// Fixes: 	  1. Added rb_base_url to start of the link as some users don't have modx installed off the root of thier site
                	//			  2. Removed the path setting at the top so just change your path in the include line. 
                	//			  3. Removed the unused include.php while code. 
                	// 
                	// *********************************************************************************
                	
                	
                	// **** There should be no need to edit anything else under this section.    *******
                
                
                // The following includes the modxapi library
                $modx = new MODxAPI();
                $html = $modx->executeDocument(3); // Used to start off the api. 
                
                
                $furls = $modx->config["friendly_urls"];	// Stores the FURL Settings for the site
                $siteurl = str_replace("assets/","", $modx->config["rb_base_url"]);
                
                // If the site uses FURL we set up our vars so we don't have to keep calling the DB
                if ($furls == 1) {
                	$furl_prefix = $modx->config["friendly_url_prefix"];
                	$furl_suffix = $modx->config["friendly_url_suffix"];
                }
                
                ?>
                <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
                
                <html>
                	<head>
                		<title>CMS Link - Insert CMS Made Simple Link</title>
                		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
                		<meta content="noindex, nofollow" name="robots">
                		
                		<link rel="StyleSheet" href="dtree.css" type="text/css" />
                		<script type="text/javascript" src="dtree.js"></script>
                		<script type="text/javascript" src="fckcmscontent.js"></script>
                		<script type = "text/javascript">
                			function addInfo(myString)
                			 {
                			  var listen1 = document.getElementById("PageURL");
                			  var listen = document.getElementById("txtSelection");
                			  listen.value = myString;
                  			  listen1.value = myString;
                			 }
                		</script>
                		<script type="text/javascript">
                		
                		<!--
                			var oEditor			= window.parent.InnerDialogLoaded(); 
                			var FCK				= oEditor.FCK; 
                			var FCKLang			= oEditor.FCKLang ;
                			var FCKConfig		= oEditor.FCKConfig ;
                			var FCKCMSContent	= oEditor.FCKCMSContent; 
                			 
                			// oLink: The actual selected link in the editor.
                			var oLink = FCK.Selection.MoveToAncestorNode( 'A' ) ;
                			if ( oLink )
                				FCK.Selection.SelectNode( oLink ) ;
                	
                			window.onload = function ()	{ 
                				// First of all, translates the dialog box texts.
                				oEditor.FCKLanguageManager.TranslatePage(document);
                				
                				LoadSelected();							//See function below 
                				window.parent.SetOkButton( true );		//Show the "Ok" button. 
                				
                				
                			} 
                			 
                			//If an anchor (A) object is currently selected, load the properties into the dialog 
                			function LoadSelected()	{
                				var sSelected;
                				
                				if ( oEditor.FCKBrowserInfo.IsGecko ) {
                					sSelected = FCK.EditorWindow.getSelection();
                				} else {
                					sSelected = FCK.EditorDocument.selection.createRange().text;
                				}
                
                				if ( sSelected == "" ) {
                					//alert( 'Please select a text in order to create a (internal) link' );
                				} else {
                					var listen = document.getElementById("txtTitle");
                			  		listen.value = sSelected;
                				}
                
                			}
                
                			//Code that runs after the OK button is clicked 
                			function Ok() {
                				//Validate is option is selected
                
                				var oDoc = document.getElementById( 'PageURL' );
                				
                				if(oDoc.value == "") {
                					alert('Please select a page in order to create a link');
                					return false;
                				} 
                				
                				
                				var oTagLink = document.getElementById( 'chkTaglink' );
                				var oLinkTitle = document.getElementById( 'txtTitle' );
                				if (oLinkTitle.value == "") {
                					alert('Please enter a Link Title');
                					return false;
                				}
                				
                				if (oTagLink.checked) {
                					//Create special CMS tag
                					var sSelected;
                					
                				
                				
                					var sURL = document.getElementById( 'PageURL' ) ; 								
                					var sTagOutput = '<a href="' + sURL.value + '">' + document.getElementById( "txtTitle").value + '</a>';
                					oEditor.FCK.InsertHtml( sTagOutput );
                								
                				} else {
                					var sURL = document.getElementById( 'PageURL' ) ; 
                					oLink = oEditor.FCK.CreateLink( sURL.value ) ;
                				}
                				return true;
                			} 
                			
                		//-->
                		</script>
                	</head>
                			
                	<body scroll="yes" style="overflow:hidden;">
                		 <input type="hidden" id="PageURL" value="" />
                		 <table height="100%" cellSpacing="0" cellPadding="0" width="100%" border="0"> 
                		 	<tr> 
                				<td>
                					<table width="100%">
                						<tr>
                							<td colspan="2"><span fckLang="DlgCMSCommentPageSelection">Select a CMS Page to link to:</span> </td>
                						</tr>
                						<tr>
                							<td colspan="2">
                				
                				<div class="dtree">
                
                	<p><a href="javascript: d.openAll();">open all</a> | <a href="javascript: d.closeAll();">close all</a></p>
                
                	<script type="text/javascript">
                		<!--
                		d = new dTree('d');
                
                		d.add(0,-1,'Modx Pages');
                
                		<?php
                		
                		// Here we execute a query to get all the docs in modx, 
                		// At the moment it includes hidden docs etc. 
                		
                		$sql = "SELECT * FROM ".$modx->getFullTableName("site_content") ." ORDER BY isfolder DESC ";
                		
                		$docsrs = $modx->dbQuery($sql);  # Execute the Query
                		$docslimit = $modx->recordCount($docsrs);  # Number of pages found
                		
                		// I decided to add an IF Clause before the for loop, I fugured if I keep doing if in the loop it would slow things down. 
                		
                		// Below we cater for FURL's and none FURL's
                		if ($furls == 1) { 
                			// This will output FURL links with prefix and suffix. 
                			for($i = 0; $i < $docslimit; $i++) {
                				$docs = $modx->fetchRow($docsrs); 
                					echo "d.add(" .$docs['id'] ."," .$docs['parent'] .",'" .$docs['pagetitle'] ." <font color=blue>(" .$docs['id'] .")</font>','javascript:addInfo(\'[~" .$docs['id'] ."~]\');');\n";
                			} 
                			
                		} else {
                			// This will output std links i.e http://www.spcs.eu/index.php?id=13
                			for($i = 0; $i < $docslimit; $i++) {
                				$docs = $modx->fetchRow($docsrs); 
                					echo "d.add(" .$docs['id'] ."," .$docs['parent'] .",'" .$docs['pagetitle'] ." <font color=blue>(" .$docs['id'] .")</font>','javascript:addInfo(\'[~" .$docs['id'] ."~]\');');\n";
                					
                
                			} 
                		}
                		?>
                		
                		d.config.folderLinks = false;
                		d.config.useCookies = false;
                		document.write(d);
                
                		//-->
                	</script>
                
                </div>
                							</td>
                						</tr>
                						<tr>
                							<td nowrap><span fckLang="DlgCMSCommentTitle">Link Title</span> </td>
                							<td width="100%" style="align:right;"><input id="txtTitle" style="WIDTH: 98%" type="text" name="txtTitle"></td>
                						</tr>
                						<tr>
                							<td nowrap><span fckLang="DlgCMSCommentTitle">Selection</span> </td>
                							<td width="100%" style="align:right;"><input id="txtSelection" disabled="true" style="WIDTH: 98%" type="text" name="txtSelection"></td>
                						</tr>
                						<tr>
                							<td nowrap><span fckLang="DlgCMSCommentTagLink">Generate Link Title?</span> </td>
                							<td><input id="chkTaglink" type="checkbox" name="chkTaglink" /></td>
                						</tr>
                					</table>
                				</td>
                			</tr>
                		</table>
                		
                	</body>
                </html> 
                


                BTW: The path mentioned in the top can be maintained if you place your modx api in the main modx folder next to the .htaccess and the index.php file.
                  • 25003
                  • 9 Posts
                  Has anyone had experience of using this with MODx Evolution, and also with FCKeditor 2.6.4 as I can’t seem to get it to work. I’ve followed the instructions but with no success. I just get the MODx "loading" graphic in a pop up window and it doesn’t display the site tree.