Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
348 views
in Technique[技术] by (71.8m points)

PHP / vBulletin How to create a function when you have all other data (a reverse engineer process)

Being relatively new with PHP still I set out to create a notifications system for vBulletin 3x that is a little more modern after being inspired by a friends site. I started with asking if he would share his version, but to encourage me to learn he said he would only provide me one file. It has now been 2 months and I can't for the life of me figure this out...

The file I was provided can be found HERE. Loading the file directly (within a vbulletin 3 installation) I received an error right off the back on line 55

$notificationsQuery = get_user_notifications($userid,$vbulletin->GPC['cat'],$vbulletin->GPC['type'],$range_lower,$max_notifications);

Missing the get_user_notifications function meant I needed to create it. Which is where the question lies, How can I go about creating this function, keeping in mind I am still newer to PHP.

What Have I done already?

Well not knowing where to begin with the function creation I used the file to make everything else I thought I'd need.

I have created my table (although still may need built upon):

CREATE TABLE notifications (
  seen tinyint(2) unsigned NOT NULL default '0',
  read_notification tinyint(2) unsigned NOT NULL default '0',
  for_userid mediumint(10) unsigned NOT NULL default '',
  dateline int unsigned NOT NULL default '0',
);

Along with template changes to accommodate the notifications.

I know there will still be more to this, but I feel this function creation needs to happen before I can proceed any further.

question from:https://stackoverflow.com/questions/65948914/php-vbulletin-how-to-create-a-function-when-you-have-all-other-data-a-reverse

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...