Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SUBSTRING(node.title, 1, :node_title) = :node_title1
- SUBSTRING(node.title, 1, 1) =REGEXP ('[0-9]')
- function custom_views_query_alter(&$view, &$query){
- $current_view=&$view;
- switch($current_view->name){
- case 'glossary':
- if($query->where[0]['conditions'][0]['value'][':node_title1']=='0-9'){
- $query->where[0]['conditions'][0]['field']= "SUBSTRING(node.title, 1, 1) =REGEXP ('[0-9]')";
- echo "YES";
- dpm($query->where);
- } } }
- function custom_views_query_alter(&$view, &$query){
- $current_view=&$view;
- switch($current_view->name){
- case 'glossary':
- if($query->where){
- if($query->where[0]['conditions'][0]['value'][':node_title1']=="0-9"){
- $query->where[0]['conditions'][0]['field'] = "SUBSTRING(node.title, 1, 1) REGEXP ('[0-9]')";
- dpm($query->where);
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment