131
zivXP
Re: Restrict the "title" field
  • 2023/8/11 12:22

  • zivXP

  • Not too shy to talk

  • Posts: 113

  • Since: 2006/2/9 1


Quote:

goffy wrote:
hi

you can add a truncate in your template file
e.g. <{$title|truncate:80}>


Thanks!



132
zivXP
Re: Restrict the "title" field
  • 2023/8/11 12:15

  • zivXP

  • Not too shy to talk

  • Posts: 113

  • Since: 2006/2/9 1


I did what I needed to do. Maybe someone else will need it.
modules/news/include
edit files storyform.inc.php and storyform.original.php

$sform = new XoopsThemeForm(_NW_SUBMITNEWS, "storyform", XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/submit.php');
$sform->setExtra('enctype="multipart/form-data"');
$sform->addElement(new XoopsFormText(_NW_TITLE, 'title', 50, 255, $title), true);

replace 255 with 80

This is done for a news aggregator, as conditions have changed there.



133
goffy
Re: Restrict the "title" field
  • 2023/8/10 16:21

  • goffy

  • Just can't stay away

  • Posts: 535

  • Since: 2010/12/27


hi

you can add a truncate in your template file
e.g. <{$title|truncate:80}>



134
zivXP
Restrict the "title" field
  • 2023/8/10 11:51

  • zivXP

  • Not too shy to talk

  • Posts: 113

  • Since: 2006/2/9 1


How can I limit the "title" field in admin-form of "news 1.66" module to 80 characters?
In which file can this be done?

I've been trying to figure it out: modules\news\admin\index.php
case 'newarticle':
xoops_cp_header();
news_adminmenu(1);
include_once XOOPS_ROOT_PATH . '/class/module.textsanitizer.php';
newSubmissions();
autoStories();
lastStories();
expStories();
echo '

' . _AM_POSTNEWARTICLE . '

';
$type = 'admin';
$title = ''; - Is there any way to change this to limit the length of the field?
$topicdisplay = 0;

But that's probably not how it's done.



135
cadch
Re: How to use XOOPS tree?
  • 2023/8/5 16:52

  • cadch

  • Just popping in

  • Posts: 48

  • Since: 2007/12/17


Thank Mamba~
I connect database change
$tree = new XoopsTree($table,'id','parent');

Is succeeded.
I have a request
"class XoopsTree function"
Is it possible to add options for "ASC" and "DESC"?



136
Mamba
Re: How to use XOOPS tree?
  • 2023/7/23 8:27

  • Mamba

  • Moderator

  • Posts: 11373

  • Since: 2004/4/23


My mistake! My apologies!

It should be /xoopstree.php and not /tree.php

Please use this line:
require_once XOOPS_ROOT_PATH '/class/xoopstree.php';
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs



137
cadch
Re: How to use XOOPS tree?
  • 2023/7/21 14:33

  • cadch

  • Just popping in

  • Posts: 48

  • Since: 2007/12/17


I have a message
Error: Class "XoopsTree" not found

Can you help me



138
cadch
Re: How to use XOOPS tree?
  • 2023/7/21 11:38

  • cadch

  • Just popping in

  • Posts: 48

  • Since: 2007/12/17


Thank Mamba~



139
Mamba
Re: How to use XOOPS tree?
  • 2023/7/20 0:42

  • Mamba

  • Moderator

  • Posts: 11373

  • Since: 2004/4/23


To utilize the XOOPS tree structure for the given array, you can follow these steps:

1. Initialize the XOOPS Tree class:

require_once XOOPS_ROOT_PATH '/class/xoopstree.php';
$tree = new XoopsTree();


2. Define the XOOPS tree structure using the array:

$treeData = array(
    array(
'id' => 1'parent' => 0),
    array(
'id' => 2'parent' => 0),
    array(
'id' => 3'parent' => 0),
    array(
'id' => 4'parent' => 1),
    array(
'id' => 5'parent' => 4),
    array(
'id' => 6'parent' => 5)
);

foreach (
$treeData as $data) {
    
$tree->addNode($data['id'], $data['parent']);
}



3. Retrieve the tree structure using the XOOPS Tree class:

$treeStructure $tree->getChildTreeArray(0);


The `$treeStructure` variable will contain the hierarchical structure of the tree, starting from the root node with ID 0. You can then process and utilize this structure as per your requirements.
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs



140
zivXP
Re: Fatal error: Array and string offset access syntax with curly braces is no longer supported in /home
  • 2023/7/19 10:02

  • zivXP

  • Not too shy to talk

  • Posts: 113

  • Since: 2006/2/9 1


Quote:

Masxmas wrote:
It is the error that I get and I can not enter the xoops administration. Mark a file in php and the wrong line of code.


There is no such public_html/cms directory in xoops




TopTop
« 1 ... 11 12 13 (14) 15 16 17 ... 29425 »



Login

Who's Online

660 user(s) are online (319 user(s) are browsing Support Forums)


Members: 0


Guests: 660


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits