Global Navigation

header

Main Navigation

Sub-Navigation

Content

 

DB query and Placeholders for the MODx Wiki

Custom table snippet with custom placeholders.
To access a custom table you have in your MODx database from a snippet and use some custom placeholders to render the output. Create a new snippet to call on your page:

<?php
$output = '';
$sql = $modx->db->query( 'SELECT * FROM `tblprojects` LIMIT 0, 1000');
$resultArray = $modx->db->makeArray( $sql );
foreach($resultArray as $item)
{
$params['award'] = $item['Grant_Award'];
$params['ref'] = $item['Project_Ref'];
$params['area'] = $item['LA_Area'];
$output .= $modx->parseChunk('ProjectTpl', $params, '[+', '+]');
}
return $output;
?>

Full wiki article is here.

 

Manager Lockout

Forgot username and password or been blocked ?
Assuming you have PHPMyAdmin or something similar.

Open your Modx database with said application.

Forgot
Step One :

  1. Go to the table modx_manager_users
  2. Edit record id 1
  3. username = admin
  4. password = e10adc3949ba59abbe56e057f20f883e
  5. Save record
  6. Exit database application
  7. Go to Modx Manager login
  8. Username = admin
  9. Password = 123456

Step Two :

  1. Go to the table modx_manager_users
  2. Edit record id 1
  3. username = admin
  4. password = e10adc3949ba59abbe56e057f20f883e
  5. Save record
  6. Exit database application
  7. Go to Modx Manager login
  8. Username = admin
  9. Password = 123456

Blocked

  1. Go to the table modx_user_attributes
  2. Edit record id 1
  3. blocked = 0
  4. Save record
  5. Exit database application
  6. Go to Modx Manager login
  7. Login with your username and password

Full wiki article is here.

modx

Footer