vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   How can I edit a php file in vb3.5.0 ? (https://vborg.vbsupport.ru/showthread.php?t=95159)

BoYagoob 08-27-2005 09:03 AM

How can I edit a php file in vb3.5.0 ?
 
Hello,

Due to the new system used in vb 3.5.0, I would like to know how can I preform this hack used in 3.0.x to 3.5.x :

Quote:

Step 2, open usercp.php
Step 3,
---- find ----

if (!$bbuserinfo['userid'] OR !($permissions['forumpermissions'] & CANVIEW))
{
print_no_permission();
}

// main page:

---- end find ----

Step 4,
---- below add ----

// ########## start notes ############

if ($_POST['do'] == "notes")
{
$bbuserinfo['notepad'] = $_POST['notes'];
$notesql = "UPDATE " . TABLE_PREFIX . "user SET notepad = '" . addslashes($bbuserinfo['notepad']) . "' WHERE userid = $bbuserinfo[userid]";
$DB_site->query($notesql);
}

// ######### end notes ##############

---- end below add ----

Step 5, save file + close
Please, can you help me in his issue ?

Regards ..

Marco van Herwaarden 08-27-2005 09:21 AM

Well most stuff in there has changed a lot in 3.5. Also it is prefered not to do any editing anymore, but rely on plugins.

I would suggest that you have a look if that hack is already available for 3.5, and otherwise post a porting request in the original hacks thread.

BoYagoob 08-27-2005 09:36 AM

Thanks sir for your reply,

actually, I tried to find an upgrade for this hack, but it didn't release yet ..

also, I post a porting request there:

https://vborg.vbsupport.ru/showthread.php?t=94824

I wish any one can help me ..

Regards ..

Andreas 08-27-2005 12:21 PM

Hook: usercp_start
PHP Code:

if ($_POST['do'] == 'notes')
{
    
$userdata =& datamanager_init('User'$vbulletinERRTYPE_STANDARD);
    
$userdata->set_existing($vbulletin->userinfo);
    
$userdata->set('notes'$vbulletin->input->clean_gpc('p''notes'TYPE_NOHTML));
    
$userdata->save();


Hook: userdata_start
PHP Code:

$this->validfields['notes'] = array(TYPE_NOHTMLREQ_NO); 


BoYagoob 08-27-2005 01:04 PM

Many thanks KirbyDE for your reply.

Now I tried the codes you provied ..

but I couldn't find this hook name: userdata_save

I tried userdata_presave and then userdata_postsave and still this problem appears:

Quote:

Parse error: parse error, unexpected T_OBJECT_OPERATOR in d:\phpdev5\www\vb350\usercp.php(74) : eval()'d code on line 4

Andreas 08-27-2005 05:00 PM

Edited the Post. Sorry.

BoYagoob 08-27-2005 06:34 PM

Thanks sir ..

But also, same problem occur ..

Quote:

Parse error: parse error, unexpected T_OBJECT_OPERATOR in d:\phpdev5\www\vb350\usercp.php(74) : eval()'d code on line 4
and cannot save any notes I tried to write ..



Small Question: about the title, I wrote: user notepad
for both hooks and wrote different titles but the problem still occur ..
I mean, shall I write a specific title for both?

Thanks again ..

Andreas 08-28-2005 03:50 AM

Seems to work just fine for me.

BoYagoob 08-28-2005 06:12 AM

mmm ..

ok .. let me upload the forum online and I will install and test the hack ..

maybe the porblem in the localhost or some mistakes ..

and I will tell you what will happen to me ..

Many thanks sir for your help and support ..


All times are GMT. The time now is 02:14 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01126 seconds
  • Memory Usage 1,735KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete