Jump to content

fredbob

Members
  • Posts

    26
  • Joined

  • Last visited

Posts posted by fredbob

  1. Hi All,

    Just wondering if anyone has succ essfully run ProcessWire on an Azure App Service, Linux not Windows. Started off with a fresh install:

    1. Uploaded site files
    2. Setup Azure MySQL server
    3. Ran installer

    During the installer I get this error:

    Warning: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time in /home/site/wwwroot/wire/core/Session.php on line 247
    Warning: session_name(): Cannot change session name when headers already sent in /home/site/wwwroot/wire/core/Session.php on line 251
    Warning: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time in /home/site/wwwroot/wire/core/Session.php on line 257
    Warning: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time in /home/site/wwwroot/wire/core/Session.php on line 258
    Warning: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time in /home/site/wwwroot/wire/core/Session.php on line 259
    Warning: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time in /home/site/wwwroot/wire/core/Session.php on line 260
    Warning: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time in /home/site/wwwroot/wire/core/Session.php on line 272

    Then I proceed to login

    ProcessWire: ProcessLogin: This request was aborted because it appears to be forged.

    DEBUG MODE BACKTRACE ($config->debug == true):
    #0 /home/site/wwwroot/wire/modules/Inputfield/InputfieldForm.module(155): ProcessWire\SessionCSRF->validate()
    #1 /home/site/wwwroot/wire/core/Wire.php(397): ProcessWire\InputfieldForm->___processInput(Object(ProcessWire\WireInputData))
    #2 /home/site/wwwroot/wire/core/WireHooks.php(823): ProcessWire\Wire->_callMethod('___processInput', Array)
    #3 /home/site/wwwroot/wire/core/Wire.php(465): ProcessWire\WireHooks->runHooks(Object(ProcessWire\InputfieldForm), 'processInput', Array)
    #4 /home/site/wwwroot/wire/modules/Process/ProcessLogin/ProcessLogin.module(362): ProcessWire\Wire->__call('processInput', Array)
    #5 /home/site/wwwroot/wire/core/Wire.php(394): ProcessWire\ProcessLogin->___execute()
    #6 /home/site/wwwroot/wire/core/WireHooks.php(823): ProcessWire\Wire->_callMethod('___execute', Array)
    #7 /home/site/wwwroot/wire/core/Wire.php(465): ProcessWire\WireHooks->runHooks(Object(ProcessWire\ProcessLogin), 'execute', Array)
    #8 /home/site/wwwroot/wire/core/ProcessController.php(337): ProcessWire\Wire->__call('execute', Array)
    #9 /home/site/wwwroot/wire/core/Wire.php(394): ProcessWire\ProcessController->___execute()
    #10 /home/site/wwwroot/wire/core/WireHooks.php(823): ProcessWire\Wire->_callMethod('___execute', Array)
    #11 /home/site/wwwroot/wire/core/Wire.php(465): ProcessWire\WireHooks->runHooks(Object(ProcessWire\ProcessController), 'execute', Array)
    #12 /home/site/wwwroot/wire/core/admin.php(153): ProcessWire\Wire->__call('execute', Array)
    #13 /home/site/wwwroot/wire/modules/AdminTheme/AdminThemeUikit/controller.php(15): require('/home/site/wwwr...')
    #14 /home/site/wwwroot/site/templates/admin.php(15): require('/home/site/wwwr...')
    #15 /home/site/wwwroot/wire/core/TemplateFile.php(318): require('/home/site/wwwr...')
    #16 /home/site/wwwroot/wire/core/Wire.php(394): ProcessWire\TemplateFile->___render()
    #17 /home/site/wwwroot/wire/core/WireHooks.php(823): ProcessWire\Wire->_callMethod('___render', Array)
    #18 /home/site/wwwroot/wire/core/Wire.php(465): ProcessWire\WireHooks->runHooks(Object(ProcessWire\TemplateFile), 'render', Array)
    #19 /home/site/wwwroot/wire/modules/PageRender.module(536): ProcessWire\Wire->__call('render', Array)
    #20 /home/site/wwwroot/wire/core/Wire.php(397): ProcessWire\PageRender->___renderPage(Object(ProcessWire\HookEvent))
    #21 /home/site/wwwroot/wire/core/WireHooks.php(823): ProcessWire\Wire->_callMethod('___renderPage', Array)
    #22 /home/site/wwwroot/wire/core/Wire.php(465): ProcessWire\WireHooks->runHooks(Object(ProcessWire\PageRender), 'renderPage', Array)
    #23 /home/site/wwwroot/wire/core/WireHooks.php(924): ProcessWire\Wire->__call('renderPage', Array)
    #24 /home/site/wwwroot/wire/core/Wire.php(465): ProcessWire\WireHooks->runHooks(Object(ProcessWire\Page), 'render', Array)
    #25 /home/site/wwwroot/wire/modules/Process/ProcessPageView.module(213): ProcessWire\Wire->__call('render', Array)
    #26 /home/site/wwwroot/wire/core/Wire.php(397): ProcessWire\ProcessPageView->___execute(true)
    #27 /home/site/wwwroot/wire/core/WireHooks.php(823): ProcessWire\Wire->_callMethod('___execute', Array)
    #28 /home/site/wwwroot/wire/core/Wire.php(465): ProcessWire\WireHooks->runHooks(Object(ProcessWire\ProcessPageView), 'execute', Array)
    #29 /home/site/wwwroot/index.php(55): ProcessWire\Wire->__call('execute', Array)
    #30 {main}
    • I've changed permissions
    • Checked .htaccess
    • Set PHP session path
    • Azure - ARR affinity (Improve performance of your stateless app by turning Affinity Cookie off, stateful apps should keep this setting on for compatibility. Learn more)
    • Azure - Always on (Prevents your app from being idled out due to inactivity)

    Envirnomnet

    If anyone has gotten this to work some pointers would be great! I've decided I don't want to run it on a Windows App Service, as I would have to convert .htaccess to web.config and ProcessWire is designed and supported for Apache / Linux web servers.

    Any help is appreciated!

     

  2. On 10/11/2018 at 5:16 AM, rastographics said:

    Installed fresh processwire from scratch on identical hosting setup.

    When going through installer, everything checks out as normal, except on the final review page after install, these errors appear:

     

    image.thumb.png.f77987a9a642d82ee7fdb38658e78e44.png

     

    I can still continue on to login page, but original error is still present and prevents login.

    Did you ever work this one out?
    I'm trying to run Processwire on Azure App Service (Linux), file permissions are set correct, and I have set the PHP session path.

    I get the same errors on installation, then I can't looking due to the "ProcessWire: ProcessLogin: This request was aborted because it appears to be forged." error.

  3. I left this for a while, and have just come back to it.

    @BitPoet That creates the user okay, but doesn't allow to change the name, email, pass etc (in my testing anyway), it just created the user with today's date and time.

    For anyone who is interested, this is my solution.

    $u = $pw2->wire(new User());
    $u->of(false);
    $u->name = $username;
    $u->email = $email;
    $u->pass = $password;
    $u->addRole("client");
    $u->admin_theme = ("AdminThemeUikit");
    $u->save();
    $u->of(true); 

    Credit from 

     

    • Like 2
  4. Hi!

    So I am trying to pull some information from another ProcessWire installation within the admin area (_main.php / page tree from the AdminThemeUikit module).

    $pwpath = "/path/";
    $pwurl = "https://url.example";
    $pw = new ProcessWire($pwpath , $pwurl);

    which then gives me this error

    Quote

    Error: Uncaught Error: Class 'ProcessWire' not found

     

    I then read that if it is not already in a ProcessWire environment that I would have to include the core, 

    require('/path/to/wire/core/ProcessWire.php'); 

    Which I tried, and makes sense that it already says it is included.

     

    So what now?

     

    Here is my _main.php from the AdminThemeUikit module (work in progress), just for reference

    Spoiler
    
    <?php namespace ProcessWire;
    /**
     * _main.php: Main markup template file for AdminThemeUikit
     *
     * FileCompiler=0
     *
     */
    
    /** @var Config $config */
    /** @var AdminThemeUikit $adminTheme */
    /** @var User $user */
    /** @var Modules $modules */
    /** @var Notices $notices */
    /** @var Page $page */
    /** @var Process $process */
    /** @var Sanitizer $sanitizer */
    /** @var WireInput $input */
    /** @var Paths $urls */
    /** @var string $layout */
    
    if(!defined("PROCESSWIRE")) die();
    
    $adminTheme->renderExtraMarkup('x'); // forces it to cache
    if(!isset($content)) $content = ''; ?>
    <!DOCTYPE html>
    <html class="pw" lang="<?php echo $adminTheme->_('en');
    	/* this intentionally on a separate line */ ?>">
    <head>
       	<?php 
       	include($config->paths->adminTemplates . '_head.php');
    	echo $adminTheme->renderExtraMarkup('head');  
    	?>
    </head>
    <body class='<?php echo $adminTheme->getBodyClass(); ?>'>
    
    	<?php
    	if($layout == 'sidenav') {
    		include(__DIR__ . "/_sidenav-masthead.php");
    		
    	} else if($layout == 'sidenav-tree' || $layout == 'sidenav-tree-alt') {
    		// masthead not rendered in this frame
    		echo $adminTheme->renderNotices($notices);
    		echo "<div class='uk-margin-small'></div>";
    		
    	} else if($layout == 'modal') {
    		// no masthead
    		echo $adminTheme->renderNotices($notices);
    		
    	} else {
    		include(__DIR__ . "/_masthead.php");
    	}
    	?>
    
    	<!-- MAIN CONTENT -->
    	<main id='main' class='pw-container uk-container uk-container-expand uk-margin uk-margin-large-bottom'>
    		<div class='pw-content' id='content'>
    			
    			<header id='pw-content-head'>
    				
    				<?php if($layout != 'sidenav' && $layout != 'modal') echo $adminTheme->renderBreadcrumbs(); ?>
    
    				<div id='pw-content-head-buttons' class='uk-float-right uk-visible@s'>
    					<?php echo $adminTheme->renderAddNewButton(); ?>
    				</div>
    
    				<?php 
    				$headline = $adminTheme->getHeadline();
    				$headlinePos = strpos($content, ">$headline</h1>");
    				if(!$adminTheme->isModal && ($headlinePos === false || $headlinePos < 500)) {
    					echo "<h1 class='uk-margin-remove-top'>$headline</h1>";
    				}
    				?>
    				
    			</header>
    		
    			<?php if($page->id == 3): // this is the id to the page that produces the page tree ?>
    			<div class="uk-grid-match" uk-grid>
    				<div class="uk-width-2-3@m">
    					<div>
    						<?php echo $content; // page tree ?>
    					</div>
    				</div>
    				<div id="getting-started" class="bp-card uk-visible@m uk-width-1-3@m">
    					<div class="uk-card uk-card-default uk-card-body">
    						<h3>Getting Started</h3>
    						<ul class="uk-list uk-list-striped">
                                <? // ==== Processwire Multi Instance ===== // 
                             	$pwpath = "/path/";
                             	$pwurl = "https://url.example";
                              	$pw = new ProcessWire($pwpath , $pwurl);
    							?>
                            </ul>
    						<h3>Notices</h3>
    					    	<p>Hello and hello</p>
    						<h3>Warnings</h3>
    					    	<p>Hello and hello</p>
    					</div>
    				</div>
    			</div>
    			
              	<!-- Hides #getting-started section if the Page tree is called from the side bar (modal) -->
    			<script type="text/javascript">
    			if($("body").hasClass("modal")) {
    		    	 $("#getting-started").hide();
    			}
    			</script>
    			
    			<?php else: ?>
    			<div id='pw-content-body'>
    				<?php
    				echo $page->get('body');
    				echo $content;
    				echo $adminTheme->renderExtraMarkup('content');
    				?>
    			</div>
    			<?php endif; ?>
    			
    		</div>
    	</main>
    
    	<?php
    	if(!$adminTheme->isModal) {
    		include(__DIR__ . '/_footer.php');
    		if($adminTheme->isLoggedIn && strpos($layout, 'sidenav') !== 0) include(__DIR__ . '/_offcanvas.php');
    	}
    	echo $adminTheme->renderExtraMarkup('body');
    	?>
    	
    	<script>
    		<?php	
    		if(strpos($layout, 'sidenav-tree') === 0) {
    			echo "if(typeof parent.isPresent != 'undefined'){";
    			if(strpos($process, 'ProcessPageList') === 0) {
    				echo "parent.hideTreePane();";
    			} else {
    				echo "if(!parent.isMobileWidth() && parent.treePaneHidden()) parent.showTreePane();";
    			}
    			if($process == 'ProcessPageEdit' && ($input->get('s') || $input->get('new'))) {
    				echo "parent.refreshTreePane(" . ((int) $input->get('id')) . ");";
    			}
    			echo "}";
    		}
    		?>
    		ProcessWireAdminTheme.init();
    	</script>
    </body>
    </html>

     

     

  5. Is it possible to create users from another ProcessWire instance.

     

    This is my code for a registration page, it creates the user, but doesn't update it with the username, password and email.

    I presume this is because $u is on the current page, and not in the instance, and when $u is saved its not updating it on the other instance.

    I can't figure it out, if anyone has any ideas thy would be greatly appreciated. 

    <?php
    if ($input->post->submit) {
        $username = $sanitizer->username($input->post->username);
        $email = $sanitizer->email($input->post->email);
        $password = $input->post->password;
        
        echo $username;
        echo $email;
    
        $clientbp = new ProcessWire('/path/', 'http://domain.com');
    
        $u = $clientbp->wire(new User());
        $u->of(false);
        $u->name = $username;
        $u->email = $email;
        $u->pass = $password;
        $u->addRole("guest");
        $u->save();
        $u->of(true);
    }
    ?>
    <form action="./" accept-charset="UTF-8" autocomplete="off" method="post">
            <input type="text" name="username" placeholder="Username">
            <input type="text" name="email" placeholder="Email">
            <input type="password" name="password" placeholder="Password">
        <button type="submit" name="submit" value="register">Register</button>
    </form>

     

  6. On 6/18/2017 at 3:45 PM, xfroggy said:

    I have a couple of questions about the module,

    I am using multisite 0.0.6 (unsure if this is the latest?) in conjunction with Admin Restrict Branch, in the admin area I am going to have a couple of admin listing pages that will, for example list all the pages with the template 'bob'. The admin restrict is setup so when 'user1' logs in they can only see the user1 branch, and same for 'user2' and so on. Each users domain is setup so it is 'user1.example.com'. What I am after is when a user logs in and goes to the listing page, it will find all of the template 'bob' but only in their brand. 

    
    <?php
    foreach($pages->find("template=bob") as $bob):
    	echo $bob->title;
    endforeach;
    ?>
    
    Right now this code, displays all of the pages that have the 'bob' template not just the ones in the restricted branch.
    Any ideas?
    This works to find the 'user1' page if user1 is logged in. But I can't figure it out.
    
    
    
    <?php
    	// This is the variable for the root users page (i.e the users home page)
    	$userroot = $pages->find("name=" . $user->name);
    ?>
    
    Also, I would like the same in the frontend, so when a user goes to 'user1.example.com' and I run the same code as above it will do the same thing.
    For now, I have done this, which works. I don't know if this is good practice or not?
    
    
    
    <?php
    $pages = $page->rootParent;
    ?>
    
    -main
    --user1
    ---Page1 (template=bob)
    ---Page2 (template=bob)
    --user2
    ---Page3 (template=bob)
    ---page4 (template=bob)
    -Admin
    --Listing Page
    -Trash

    I am a bit silly, 

    $client = $pages->get("name=" . $user->name);

    Replaced

    $client = $pages->find("name=" . $user->name);

    Which now means I can go

    <?php
    foreach($client->find("template=bob") as $bob):
    	echo $bob->title;
    endforeach;
    ?>

    I feel a bit silly about that, it was a simple fix between find() and get().

  7. I have a couple of questions about the module,

    I am using multisite 0.0.6 (unsure if this is the latest?) in conjunction with Admin Restrict Branch, in the admin area I am going to have a couple of admin listing pages that will, for example list all the pages with the template 'bob'. The admin restrict is setup so when 'user1' logs in they can only see the user1 branch, and same for 'user2' and so on. Each users domain is setup so it is 'user1.example.com'. What I am after is when a user logs in and goes to the listing page, it will find all of the template 'bob' but only in their brand. 

    <?php
    foreach($pages->find("template=bob") as $bob):
    	echo $bob->title;
    endforeach;
    ?>
    Right now this code, displays all of the pages that have the 'bob' template not just the ones in the restricted branch.
    Any ideas?
    This works to find the 'user1' page if user1 is logged in. But I can't figure it out.
    
    
    <?php
    	// This is the variable for the root users page (i.e the users home page)
    	$userroot = $pages->find("name=" . $user->name);
    ?>
    
    
    Also, I would like the same in the frontend, so when a user goes to 'user1.example.com' and I run the same code as above it will do the same thing.
    For now, I have done this, which works. I don't know if this is good practice or not?
    
    
    <?php
    $pages = $page->rootParent;
    ?>
    
    -main
    --user1
    ---Page1 (template=bob)
    ---Page2 (template=bob)
    --user2
    ---Page3 (template=bob)
    ---page4 (template=bob)
    -Admin
    --Listing Page
    -Trash
  8. Do you think it would be wise to use multiple sites in that way?

    Because each site is completely separate from every other site essentially. But I also need to be able to manege them all (updates, users etc)

     

    Originally, I was going to have separate cPanel account and PW installations for each user. But this is difficult to manage future updates (from PW and myself), and share user data from the user list on the main website (like password sync etc).

     

    However, the site folder and wire folder will remain THE SAME for each install, the only difference will be the data, pages etc.

  9. Hi!

    Basically I have created a website 'builder' , in ProcessWire, and how I would like it to work, is that a user signs up, on the main website, and it creates their account, which then gives them access to the website builder being their own website. Similar to how Square Space works.

    I'm not sure how to go about the multiple sites at all, if anyone could give me some pointers?

    Cheers, Sam.

  10. Hi,

    I am trying to create a frontend form that allows the user to create a page with a specific template (and fill out the fields)

    I have started to use code from this post

     

    This is my current code

    <?php
    $p = $pages->get(1029);
    $template = $p->template->name; // this is the template where we will get the fields from
    
    // make a form
    $form = $modules->get('InputfieldForm');
    $form->method = 'post';
    $form->action = './';
    $form->attr("id+name",'subscribe-form');
    
    // add the page's fields to the form
    $fields = $p->fieldgroup;
    foreach($fields as $field) {
        $inputfield = $fields->{$field->name}->getInputfield($p);
        $form->append($inputfield);
    }
    
    // add a submit button to the form
    $submit = $modules->get('InputfieldSubmit');
    $submit->name = 'save_service';
    $submit->attr("value", "Go");
    $form->append($submit);
    
    // process the form if it was submitted
    if($this->input->post->save_service) {
        // now we assume the form has been submitted.
        // tell the form to process input from the post vars.
        $form->processInput($this->input->post);
    
        // see if any errors occurred
        if( count( $form->getErrors() )) {
            // re-render the form, it will include the error messages
            echo $form->render();
        } 
        else {
            // successful form submission
            $np = new Page(); // create new page object
            $np->template = 'service'; // set template
            $np->parent = $pages->get($user); // set the parent
            $np->of(false); // turn off output formatting before setting values
            $np->save();
    
            foreach($np->fields as $f) {
                $np->set($f->name, $form->get($f->name)->value);
            }
            
            $np->save(); //create the page
    
            echo "<p>Page saved.</p>";
        }
    } else {
        echo $form->render();
    }

    And I am getting this error, I can't figure out what it is.

    Error: Exception: Unknown Selector operator: '' -- was your selector value properly escaped? (in /home/dev/public_html/wire/core/Selectors.php line 396)
    
    #0 /home/dev/public_html/wire/core/Selectors.php(439): ProcessWire\Selectors->create('41', '', '')
    #1 /home/dev/public_html/wire/core/Selectors.php(159): ProcessWire\Selectors->extractString('41')
    #2 /home/dev/public_html/wire/core/Selectors.php(145): ProcessWire\Selectors->setSelectorString(Object(ProcessWire\User))
    #3 /home/dev/public_html/wire/core/PagesLoader.php(217): ProcessWire\Selectors->init(Object(ProcessWire\User))
    #4 /home/dev/public_html/wire/core/Pages.php(232): ProcessWire\PagesLoader->find(Object(ProcessWire\User), Array)
    #5 /home/dev/public_html/wire/core/Wire.php(383): ProcessWire\Pages->___find(Object(ProcessWire\User), Array)
    #6 /home/dev/public_html/wire/core/WireHooks.php(698): ProcessWire\Wire->_callMethod('___find', Array)
    #7 /home/dev/public_html/wire/core/Wire.php(439): ProcessWire\WireHooks->runHooks(Object(ProcessWire\Pages), 'find', Ar
    
    This error message was shown because: you are logged in as a Superuser. Error has been logged.

     

    • Like 1
  11. Hi, 

    In the custom PHP selector code for a PageField how do I go about selecting pages that have a field that is the page that I am currently editing.

    $wire->addHookAfter('InputfieldPage::getSelectablePages', function($event) {
      if($event->object->name == 'field2') {
        $page = $event->arguments('page');
        $event->return = $event->pages->find('template=template1, field1=$page');
      }
    });

  12. Hi!

    I am setting up an automated installed to install ProcessWire with a site profile using Softaculous and WHMCS.

    I am creating a custom package for Softaculous, basically what it is doing is coping the appropriate files across and setting up the database from a SQL file. 

     

    What I have tried is:

    Export the SQL file straight from PhpMyAdmin

    This causes the modules not to be installed at all, you have to click refresh in the modules section for them to show up.

    Export the SQL file from PhpMyAdmin (this sets up all the dependancies etc) then copy the file from the site profile 

    I was hoping that this would install the modules as I had them in the ProcessWire install that I am trying to replicate. However I get this error

    Quote

    Error: Exception: You do not have permission to execute this module - ProcessPageView (in /home/xfroggyt/public_html/wire/core/Modules.php line 1236)

     

    If anyone has any ideas, on what would be the best way about doing this? I realize that the second version is a little bit dodgy. 

    The only other thing I can think of, is grabbing the install file that ProcessWire uses in its installer and using the SQL file or database information in that and merging it with the site profile.

  13. Hi,

    I have a field on a page that I am trying to set the selectable pages to the parent pages, multi page field.

    -- Parent (has page field with pages I want to select from)

    -- -- Child (has field that needs to be able to select pages from the parents page field)

     

    I have tried using custom PHP selectors, but in the new version of processwire the custom PHP selector has been changed into a hook. I am not sure how to write it, any help would be appreciated.

     

    Quote

     

    Add the following hook to a /site/ready.php file and modify per your needs. The hook should find and return selectable pages in a PageArray.

    
    $wire->addHookAfter('InputfieldPage::getSelectablePages', function($event) {
      if($event->object->name == 'result_judge_challenge') {
        $event->return = $event->pages->find('your selector here');
      }
    });

    If you need to know the page being edited, it is accessible from: $event->arguments('page');

     

     

    Cheers.

  14. Apologies I originally put this in the wrong sub forum.

    I am having some trouble with my admin table, I am using the MarkupAdminTable module that is included with ProcessWire.

    It is not outputting one of the columns properly when I use the links.

    I will attach two images and their corresponding code to show what is happening.

     

    The code bellow is how I want it to look but with links.

    
    <?php   
    $table = $modules->get("MarkupAdminDataTable");
    
    function publishedCol($value) {
    	if ($value == 1)
    		return "Yes";
    	else 
    		return "No";
    }
    
    function pedigreeParentsName($value) {
    	if (count($value->title) > 0)
    		return $value->title;
    	else
    		return 'No Parent Defined';
    }
    
    function pedigreeParentsLink($value)
    {
    	if (count($value->title) > 0)
    		return $value->url;
    	else
    		return $value->url;
    }
    
    /* breed id */
    $breed = $input->get['id'];
    
    $published = $input->get['pub'];
    if (empty($breed)) {
    	$table->headerRow( ["Dog", "Gender", "Sire", "Dam", "Breed", "Website display"] );
    	
    	foreach($pages->find("template=dog, sort=title") as $page){
    	  $data = array(
    		// Values with a sting key are converter to a link: title => link
    		$page->title => $config->urls->admin."page/edit/?id=".$page->id,
    		$page->dog_gender->title,
    		pedigreeParentsName($page->father),
    		pedigreeParentsName($page->mother),
    		$page->parent->title,
    		publishedCol($page->dog_create_page)
    	  );
        	$table->row($data);
    	}
    }
    else {	
    	echo "<h2>$title</h2>";
    	$table->headerRow( ["Dog", "Gender", "Sire", "Dam", "Website display"] );
    	
    	foreach($pages->find("template=dog, sort=title") as $page){
    	  $data = array(
    		// Values with a sting key are converter to a link: title => link
    		$page->title => $config->urls->admin."page/edit/?id=".$page->id,
    		$page->dog_gender->title,
    		pedigreeParentsName($page->father),
    		pedigreeParentsName($page->mother),
    		publishedCol($page->dog_create_page)
    	  );
        	$table->row($data);
    	}
    }
    
    
    // $table->footerRow( $someArray );
    
    echo $table->render();
    
    ?>

    The code below shows the issue I am having when I add the links.

    
    <?php   
    $table = $modules->get("MarkupAdminDataTable");
    
    function publishedCol($value) {
    	if ($value == 1)
    		return "Yes";
    	else 
    		return "No";
    }
    
    function pedigreeParentsName($value) {
    	if (count($value->title) > 0)
    		return $value->title;
    	else
    		return 'No Parent Defined';
    }
    
    function pedigreeParentsLink($value)
    {
    	if (count($value->title) > 0)
    		return $value->url;
    	else
    		return $value->url;
    }
    
    /* breed id */
    $breed = $input->get['id'];
    
    $published = $input->get['pub'];
    if (empty($breed)) {
    	$table->headerRow( ["Dog", "Gender", "Sire", "Dam", "Breed", "Website display"] );
    	
    	foreach($pages->find("template=dog, sort=title") as $page){
    	  $data = array(
    		// Values with a sting key are converter to a link: title => link
    		$page->title => $config->urls->admin."page/edit/?id=".$page->id,
    		$page->dog_gender->title,
    		pedigreeParentsName($page->father) => pedigreeParentsLink($page->father),
    		pedigreeParentsName($page->mother) => pedigreeParentsLink($page->mother),
    		$page->parent->title,
    		publishedCol($page->dog_create_page)
    	  );
        	$table->row($data);
    	}
    }
    else {	
    	echo "<h2>$title</h2>";
    	$table->headerRow( ["Dog", "Gender", "Sire", "Dam", "Website display"] );
    	
    	foreach($pages->find("template=dog, sort=title") as $page){
    	  $data = array(
    		// Values with a sting key are converter to a link: title => link
    		$page->title => $config->urls->admin."page/edit/?id=".$page->id,
    		$page->dog_gender->title,
    		pedigreeParentsName($page->father) => pedigreeParentsLink($page->father),
    		pedigreeParentsName($page->mother) => pedigreeParentsLink($page->mother),
    		publishedCol($page->dog_create_page)
    	  );
        	$table->row($data);
    	}
    }
    
    
    // $table->footerRow( $someArray );
    
    echo $table->render();
    
    ?>

     

    How it is supposed to look.PNG

    Broken table with links .PNG

    Broken table with links .PNG

    How it is supposed to look.PNG

  15. I think I have worked out a way for this to work, using softaculous. It enables me to push updates out to my clients when requires, and WHMCS has a module that allows an automatic install.

    I am in the process of making a custom package, I have copied the 'stock/default' installation package for ProcessWire and have modified the setup to use my site profile, I am having some permissions issues at the moment. 

    Quote

    Error: Exception: You do not have permission to execute this module - ProcessPageView (in D:\Program Files (x86)\Ampps\www\breedpost\wire\core\Modules.php line 1236)

    Which corresponds to

            if($module && empty($options['noPermissionCheck'])) {
                if(!$this->hasPermission($module, $this->wire('user'), $this->wire('page'))) {
                    throw new WirePermissionException($this->_('You do not have permission to execute this module') . ' - ' . wireClassName($module));
                }
            }

    If I comment these lines out, I am unable to login into ProcessWire, but all the pages work.

  16. Hi!

    I am setting up a sass solution using ProcessWire.

    I'd like to be able to automatically install ProcessWire with a custom site profile when someone purchases a package through WHMCS. Currently I have it create a new cPanel account, however I am not sure on how to automate the installation of ProcessWire. Another note also is that we are going to want to push out updates and maintain each installation of ProcessWire. I don't know the best way about doing this is, I've seen some other posts but majority are very vague. 

    Cheers.

×
×
  • Create New...