|
|
楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////* w& g$ m K" Z$ D! H
// Theme Option/ f5 @3 R# a5 |) t5 G
////////////////////////////////////////////////////////////////////////////////$ |. J9 E V( S0 k- h* t! f! ]
" U: j l2 N+ x
$themename = "Zenx";# i6 L. S+ Q5 P) R0 E- Z' H
$shortname = str_replace(' ', '_', strtolower($themename));
# J% O$ j; I* i$ S& ?- v
3 e+ ]9 h ~: T6 S% u) g) Mfunction get_theme_option($option)) A6 _! C+ K( T5 K/ T
{
9 ]$ V" P. ?% D# c! { global $shortname;0 t: F, u& ^: Z
return stripslashes(get_option($shortname . '_' . $option));
6 D& K8 a7 J- x5 h- i}+ S: N' T* T1 c" R$ q% t; K
, W4 A1 r! X/ R' b7 K/ Y/ W
function get_theme_settings($option)
# a( g, {0 f* x4 c! J{
2 ~/ H/ B/ D' V* H return stripslashes(get_option($option));2 x. U3 ` ~/ b4 ?+ L6 p
}2 z! |5 S# ?/ _4 T2 r
$wp_dropdown_rd_admin = $wpdb->get_results("SELECT $wpdb->term_taxonomy.term_id,name,description,count FROM $wpdb->term_taxonomy LEFT JOIN $wpdb->terms ON $wpdb->term_taxonomy.term_id = $wpdb->terms.term_id WHERE parent > -1 AND taxonomy = 'category' AND count != '0' GROUP BY $wpdb->terms.name ORDER by $wpdb->terms.name ASC");
8 O) X( Z: ]/ X7 n/ I# @- w* z$wp_getcat = array();
5 ~- y+ I4 g& T0 xforeach ($wp_dropdown_rd_admin as $category_list) {
* y/ g4 X( I8 C+ e x) F$wp_getcat[$category_list->term_id] = $category_list->name;
. e8 @7 _ b. {8 l+ W; f& o; G}
( |7 N1 u% d/ \4 k& ]1 i$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");
" R3 B. y0 m* U+ V: t- N$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");
6 ?) q# X9 B+ G/ `$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");' l) K# T) g( d8 _3 }6 ^ |
# B e3 N5 n5 `0 G# m, D$options = array (
( F3 y0 r6 d$ V2 u/ e4 O+ Q) L- A |; s; o/ A: ^9 b; v
+ H* B0 F; O1 v% j+ Y5 ?! V( H
array( "name" => "Blog Header Settings",
8 S& s2 ?% Z6 d; d/ x+ A "type" => "heading",
0 x) M5 w$ J. { D* P ),
' A7 k& I2 W H' }" _' q4 V& z$ k+ `8 ~ a0 @/ ?' i
array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",. j" D9 b6 q& w$ |7 x+ W' {
"id" => $shortname."_header_logo_activate",
! q% t/ i! V3 o1 X8 n- k# R" L "type" => "select",: q5 A- D U* X+ x
"std" => "No",
4 q X& g9 R$ H( u+ [$ W. \2 Q$ D "options" => array("No", "Yes")),
! u; Y7 j( O" i. T; q; ] F9 v' a5 [- L6 x
array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",
; u+ J, E& S1 F+ Q/ J "id" => $shortname."_logo_url",
' n) z M% o L2 i7 P% s" W "type" => "text",
$ R- Q, I' E9 S$ [, L2 F "box" => "social", a# x; o& K& y4 J8 s' o
"std" => "",
% h2 Q- O% [' P" `. U) M ), i- V( T$ `- D' P, f- G9 W$ ]
; {+ @# S7 z6 R! t
array( "name" => "Insert Header Banner HTML Code (Header)
! [5 T. X. l- W- u; Y' u5 M <br /><em>*Recommended Size 468 x 60</em>
; ]: ~, b* f3 o) z; n <br /><em>*leave blank if not use</em>",
3 W: E& M! m$ h5 h7 u "id" => $shortname."_header_banner",; b; G2 Y# F% V) t8 n
"type" => "textarea",
# I8 z9 e6 z8 y+ v2 [' s "std" => "",
; q$ b; x7 L9 [1 D$ a ),
& ~& p1 n* b# s8 c R: ^1 B
0 ~ Q- L2 p4 h array( "name" => "</div></div>",
6 M, l- ~1 p4 |& h: o "type" => "close",* T# N5 _+ F1 c- d9 p8 e6 u
),5 @) x: f+ n) ^6 I' ^% T0 ~
$ f9 Z: `# @7 g" F1 O$ h; W! |/ N6 R: O. a& ^! j2 C
array( "name" => "Header Navigation Settings",7 h: }# x) ~6 g3 \! J
"type" => "heading",
6 |$ |) `4 l5 G" U ),# \+ X9 u! R9 D
4 `# M% o, x3 F2 E! k array( "name" => "Insert Page ID To Exclude On Header Navigation<br />
! ?1 i2 X& v: j2 L8 f <em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />% O5 u' l: L O, L
<em>*Enter the page post ID number only</em><br />6 B$ v! C! I1 r4 o- ~, F0 J
<em>*separate by comma</em><br />5 u* T1 G& ^# B+ j
<em>*Exclude pages which you don't want to show on the header navigation</em>",. C0 l* s# Q* g! {2 H
"id" => $shortname."_header_page_navigation",
' v3 j7 k P+ b3 W3 J2 P "type" => "text",# S7 g7 k8 X3 E
"std" => "",
4 ^, V8 u: I" a5 | ),
6 _- F* Y# m4 s9 G" \9 s4 z7 B& W1 k5 v- i. e/ }7 b, N# S4 h
array( "name" => "</div></div>",
. V2 d4 n* q8 j Y7 L9 u "type" => "close",
' ^4 @" p Z% I: U" c8 J. D ),
* X3 m& ?5 H8 ] y" {6 P9 w
& J* i' J4 d, \5 Q9 a
$ b9 _8 }% Y+ E. L/ f3 _3 z* Q' n array( "name" => "Post Auto Thumbnails Settings",& j$ G2 r6 M1 I, _3 @* H
"type" => "heading",
, z2 G1 a2 e9 D! O" S5 s& g" U+ r ),
5 o! \+ Z/ V7 v) b/ X! ? \) |, y
* q1 }2 X! f1 S* ~4 F- q array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
. a& o( W. N. q% {" I3 ?- Y "id" => $shortname."_timthumb_activate",
- F1 m$ Q, k. n5 e7 Y "type" => "select",) o! B4 c/ O' K. u
"std" => "No",6 Z' r$ q8 \, w
"options" => array("No", "Yes")),$ n" w: }6 {/ ?$ O
, l }7 q6 s5 }' w array( "name" => "If Timthumb is enabled, Please choose its cropping method",2 {% b% X) _) q0 f" J" M7 l
"id" => $shortname."_timthumb_cropping",
( w! o( P2 t2 q6 F "type" => "select",9 S& s- k) N( B3 o, X
"std" => "",
1 _+ m% F1 E4 P$ `3 i G+ s "options" => $crop_position),
% c) R, V$ u" N* v6 v2 n- K1 `7 P. [9 R# K+ N1 G
array( "name" => "Insert Width Of Thumbnail Image<br />
' l& X% Y5 A4 @( s <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />$ p" M0 j! w7 H
<em>*Leave Blank To Use Default: 250</em><br />",
) [7 O3 o3 ^) h$ g3 s# K$ c7 ~ "id" => $shortname."_thumb_width",
6 ~ B% q) i7 H' g$ w; Y- B4 F "type" => "text",
% D; H( M7 X( i* n "std" => "",& R( p2 I; `2 U; k8 e" _
),5 C; ^8 L7 f. G6 N( W- `6 I3 k
0 M6 v3 T* y1 }; H* M# p
array( "name" => "Insert Height Of Thumbnail Image<br />! H- ~4 W( |+ |5 O) Z, N
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />6 u* M) \9 r7 E1 U/ A. u
<em>*Leave Blank To Use Default: 200</em><br />",) D5 E( Q9 a4 n. Q
"id" => $shortname."_thumb_height"," R: X; \5 @7 B5 k; g
"type" => "text",
& ]2 F9 R" @$ @# ?& v "std" => "",( x9 |& R6 g5 n& ?1 m
),( Z' [+ \8 n7 ~; y! k
4 l( K ?8 Z, c( x" M) z9 n
array( "name" => "</div></div>",
' g M) P3 o( v/ Z0 ]4 O' t "type" => "close"," R6 ^6 N' G, S! `) x# k% Y7 A
),! r0 E" T3 ?! D8 u" x9 z
' v8 T! m" z$ A7 O: y
array( "name" => "Featured Content Slider Settings",
7 T+ F5 O6 U0 S/ V "type" => "heading",
/ H# p; a- |6 j/ ?) E) ` ),$ O% i; W# M( P# J' w, g( V
, g" H) m' u: {7 Q1 P) J array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
; H# k- Q: K+ s0 u3 ? "id" => $shortname."_featured_activate",! T! }, V( H4 A$ U% A8 O3 s* X# R
"type" => "select",
( x D- i" r3 o, M; y) @3 | "std" => "No",
3 ^4 X% v' n h$ c4 \/ E7 ]& |% @ "options" => array("No", "Yes")),: r3 ^* w2 w& ]% c' m y0 A
; L* g! O5 w! V) u; l) x
/ J7 m4 O- y; G" [3 B1 u3 a& ]% H7 G array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",
; m) X8 ?% z/ T* l, X/ N* r "id" => $shortname."_featured_category",
W$ B7 }" ^! W' b; | "type" => "select",1 F' P$ m# C4 z
"std" => "Choose a category:",
7 C+ `* K" C: I, e "options" => $wp_getcat),
$ F; ]% s& ~# t$ W% n' G4 ?" F( C
array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",
V1 I, N/ s; v k9 F& [ "id" => $shortname."_featured_number",
4 S) }8 ^' X5 S/ m( r; V "type" => "select",
( Q* B: |; d- w "std" => "Number of post:",, O( A6 r# t, E, I9 H3 P2 N9 ^
"options" => $number_entries),2 |0 ]: ~' m: t
( V( C. N3 v& L) x9 f: u6 J$ A3 c/ y* ~
array( "name" => "</div></div>",$ c# P" G x3 U. {0 X$ {9 ^) {5 o, ^
"type" => "close",3 y' x+ D# T0 d( c6 T3 K
),# U# n' y0 x/ C9 U1 | ] w3 X
. P4 M' ~" ^& ~% a6 M array( "name" => "Featured Category Settings",3 E" r ^/ U5 `. T* J3 X7 I1 ~. w
"type" => "heading",% B2 _. L# A; R
),
: M7 {& W# ?* Y
2 c( I+ @; b: S5 n+ U( u) e array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
1 b) v, T4 _5 @7 A" S& ^/ i "id" => $shortname."_featured_category_activate",$ s# r* \& A' x$ ]. E8 `9 O
"type" => "select",* p6 j/ j2 I! ~1 {8 E y1 p) U) X
"std" => "No"," G9 D9 N/ g9 h9 c! i4 ~! s
"options" => array("No", "Yes")),7 L) w% g8 o% A0 A2 ]
5 Q- z1 m; [3 d$ t
array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",- S3 V2 V& ~1 S* G4 Q3 j( r
"id" => $shortname."_featured_category_id1",, |: e* B+ u) w0 r$ f9 F2 |
"type" => "select",
- ?) g8 A5 q7 ~* e/ f+ a* E "std" => "Choose a category:",
2 h( N! L- U7 Q( |- \ "options" => $wp_getcat),
2 C2 ?' F1 R: N2 e+ F4 w: l
- i; m4 }7 f* p4 H5 w+ m% B: B& n array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",: d1 |0 M6 c1 h) D8 {: K
"id" => $shortname."_featured_number1",
2 v& s4 `/ ?/ u6 h# K5 ^% d& F: ]8 d, D "type" => "select",! ]" V. n- Q5 |
"std" => "Number of post:",* m1 O* P5 G, d9 d
"options" => $number_entries),
; W1 i p1 ]+ f; S& o- O- U" y
- L2 N9 F* j% A+ Y0 [1 J array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",) P% ~/ B+ Y: s
"id" => $shortname."_featured_category_id2",
6 D, d2 h1 x% h" D- x* y7 E "type" => "select",- I; ~2 L6 r! T- |* t
"std" => "Choose a category:",0 J5 J/ i& u) C& C! w+ M
"options" => $wp_getcat),
/ d7 } e9 m' W, l
8 x1 p m) ?* q5 N array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",4 ~' ?2 Y7 i3 |& t5 N! ~
"id" => $shortname."_featured_number2",
2 V* h2 N5 W i3 j$ A "type" => "select", b5 D/ } U2 r7 o5 L
"std" => "Number of post:",( u# [7 \- J/ M; B) x
"options" => $number_entries),
0 n6 G+ V4 F& d" I+ ^1 B) h1 j: z
& A0 @, {, Z4 b, M2 c$ P + h, {9 g* n4 n8 _' Y
array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
( x) x, N: q% l# o) B* H" p4 b% i4 o& M "id" => $shortname."_featured_category_id3",
9 ?' @" @& l2 @3 \5 B "type" => "select",1 V3 Y7 a$ ?$ I ~& O
"std" => "Choose a category:",8 y6 m0 `' h+ e
"options" => $wp_getcat),
) y6 K' f4 I5 P! C2 f 2 d: W5 n* Q, F) J {6 W
array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
% z+ B* M' |% U p1 K: U "id" => $shortname."_featured_number3",/ B2 B8 [# n- h; ?) Y' L
"type" => "select",/ O+ h. b) t+ `, S
"std" => "Number of post:",! k! Q2 B/ f- `" G/ ]" Y
"options" => $number_entries),
' Y, }: o+ n/ Z0 K
/ F, W; Z3 x( V- R8 \4 k4 w( p5 ^' _9 u
array( "name" => "</div></div>",& m# l+ c6 ~( Y0 U1 `" A
"type" => "close",9 D4 h* s0 |' B# u! M
),* t( `$ [4 ]# [1 ?5 q) s2 _* D7 k
& T" ^# J# w: F# X0 ^# W
2 n1 s7 ?4 i2 c3 H9 b% B array( "name" => "Google Adsense & Analytics Settings",* Y- C* m3 P5 e- F, R& h, ?
"type" => "heading",
* ]9 ^4 o4 n) _! L' g- H ),
' _( `* j, d; f/ V% F5 ^7 s
4 s& ]+ U! M2 |: A3 ]. P( a array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",
6 A- F; x d9 ^: s( A "id" => $shortname."_adsense_loop_activate",6 }: P0 q% H$ Z$ t
"type" => "select",
s; B, o' c3 W5 ~- c7 n$ O7 C "std" => "Disable",
, X$ c2 c* [1 Z: |0 h9 O "options" => array("Disable", "Enable")), H, r# n$ I9 m1 n. `7 z' y5 k
+ C7 }( q! X: h: `7 ^7 ?$ {- u
array( "name" => "Insert Google Adsense Code For Loops Here<br />
' _$ i. t( Z/ B <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
v1 F: n3 p9 W. _ x "id" => $shortname."_adsense_loop",
- t) F/ W, p) n "type" => "textarea",
7 \9 Q7 u. X. O, t/ V, p- u "std" => "",; `) N `6 I( x# O- _; Z- Z
),
8 ^7 J$ m+ k, { o3 k7 t
4 w6 A7 K6 p* c array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",
; i6 E3 r( ?( k, o+ h "id" => $shortname."_adsense_single_activate",' u4 E3 w* U: K# o& T- Q
"type" => "select",
- c% b( I2 b1 I9 k2 s5 ?* |6 O8 S "std" => "Disable",1 [) C3 o$ _6 E: H, V; s# M
"options" => array("Disable", "Enable")),& w3 X. F& m6 ?' X, F) B
4 K# G. S0 M9 i* ^
array( "name" => "Insert Google Adsense Code For Single Page Here<br />3 w0 O% a& m& Z A; V7 T
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
, h5 s. l9 S& J "id" => $shortname."_adsense_single",6 x/ o" D# j Q" {. {3 e0 a
"type" => "textarea",
& V# F7 r" |; t* Q" N4 u- t "std" => "",
4 g- ?& y7 ~- e ),7 q j2 b( q1 c f4 w# G4 J
3 q( }( N- }0 k* f% j
4 ] L9 l& g1 }* L% w* L7 t array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",
1 S6 m' e3 h8 j* z& Y "id" => $shortname."_google_analytics",
4 a/ X& ^7 L3 ]2 y: C7 p "type" => "textarea",
5 i: l) k% R: S) a# q& G$ C "std" => "",( x- V. ^$ p" A. ]9 K
),
3 j; [8 l+ U& ` f1 R7 Q" S
' e. x7 F5 M" L4 b- `+ | array( "name" => "</div></div>"," o$ l( Z. K: t9 x4 c) m
"type" => "close",
' j+ k* C* n' v1 k1 ^+ X: x" n& r0 W ),
0 U% w1 ?1 ?3 [8 x O # k# g8 P' s: i) p
/ b \) v8 B/ }- O5 G Z
array( "name" => "AddThis Social Bookmarking Settings",
: Y( O# E9 m* C, l, w- D "type" => "heading",
4 C6 S) C9 c. y! D ),9 H2 T, ]: b$ V: s- D
2 \5 c* T% }1 G; u8 | array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>% }1 e' F: X2 |7 }5 L @
<br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",; j# n. V* s. z
"id" => $shortname."_addthis",
1 o) {5 Q( @2 H! k% x- p3 ]5 I "type" => "text"," \9 _, P, o9 r( B
"box" => "social",/ c4 }9 X" Y7 _. g! z0 I
"std" => "",
0 U. ]1 g' A6 h+ j. g0 F ),
* A/ j/ d R+ b9 T$ C
$ D" Z* s( b8 n' o& R- K8 I array( "name" => "</div></div>",, F, e1 [1 H7 w4 b1 N f B
"type" => "close",0 I- p+ V6 n& v) B% R7 m" J
),
( y6 z! l4 e3 G/ p# L- e( k- P
2 H, G, g" M' i% l8 B
, z/ Z4 h) R) `$ N 2 y1 B5 C- P# J2 W
array( "name" => "YouTube Video Settings",* ]! J2 T0 L8 T+ ?( G- V4 x! V
"type" => "heading",+ Q1 h5 F/ H. b' e
),
; X2 P5 ?3 X& m7 r
* G7 y* b; Y& \4 A array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",. o( D$ ?8 @8 G. U5 k
"id" => $shortname."_emvideo_activate",
6 T% M+ ?% N. c6 l: s6 m; t$ s "type" => "select",3 @6 P; m" [3 g4 L
"std" => "No",
5 o' ]& _& i `0 U; z* T$ D4 J "options" => array("No", "Yes")),
) ]: e' y' S5 A; C1 f
0 T( V% o5 O6 T, H9 U& Y7 B array( "name" => "Insert YouTube Video Unique Code<br /><em>*You can find videos to embed on <a href=\"http://www.youtube.com\" target=\"_blank\">YouTube</a> site.</em><br /><em>i.e. Youtube - http://www.youtube.com/watch?v=<span class=\"redbold\">Hr0Wv5DJhuk</span></em><br /><em>*Only Insert The Red Bolded Code Inside Below Setting Box.</em>",; d* ~. O- H2 x) z9 t1 q$ s
"id" => $shortname."_emvideo",+ O7 i9 M& T9 ]$ x: Q: ^+ s
"std" => "",2 O7 Q* _- q1 r* {
"type" => "text"),
: J) o: h9 k4 j" u: y( A
) r$ R0 v1 R. q9 i C* f9 ~, I0 |8 o" ? array( "name" => "</div></div>",
% X0 a O' r3 r0 V" G9 t "type" => "close",
: P* ~+ h2 e! I+ B. @: M )," w3 e0 s- w$ v* m% d
U( E, S( B+ k" m/ [% k- @1 c, i" b array( "name" => "Twitter Settings",
}( ~# {* p" q4 a& W8 j "type" => "heading",+ R6 [) \; G, ?; M
),
' h% E1 ]1 Q' z- v; d# x4 x D" v/ L5 k6 R% @9 y7 K% c
array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
- e1 f. v }: m& D "id" => $shortname."_twitter_activate",
# h" e5 C' N2 g* S "type" => "select",
- J7 s4 |) u1 B& s8 B0 c2 r "std" => "No",
1 g6 z% `. F8 O9 |- ]) Q0 g0 m "options" => array("No", "Yes")),
1 y3 q1 @0 G' Z1 ~" x6 _/ c, j3 j+ x1 _8 N
array( "name" => "Insert Your Twitter ID here
" [# E5 N# }' o. r% u/ U8 A3 L6 {" H7 p <br /><em>*leave blank if not necessary</em>
6 Z+ J$ Z$ R9 v+ { x <br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",6 z4 m/ R1 K8 c3 |
"id" => $shortname."_twitter",
0 w4 q9 ]) V" O8 C "type" => "text",& J% H7 m) ~! m. m- N
"box" => "social",
) m9 w' u5 |9 y$ @ "std" => "",
. m# s e% V5 G, |/ L0 I% f ),
1 c. C* s' E {& `6 W3 q. s
+ {; Q) i' _) H4 r( g& _% S array( "name" => "Enter Twitter Feed Count here
! g& B: g, R0 v4 Q5 G9 ]: L5 M <br /><em>*leave blank if not necessary</em>- M y. [( z6 h
<br /><em>*Enter How Many Twitter Feed To Display</em>",
+ y9 Q3 H/ g4 `/ Y4 v "id" => $shortname."_twitter_count",8 M( p( V, [( s1 |
"type" => "text",3 P3 g- B3 O1 l9 E* K" u
"box" => "social",7 D! o7 F ` C o, t) J4 ^
"std" => "",
& v Y- m0 J% A ),3 L. y5 E: M" |3 H3 x
% ?% O2 b4 T8 g4 q/ s
array( "name" => "</div></div>",
2 w0 t* x( A, Y# @: z |. A "type" => "close",
' t& J8 E- E, Z( A8 X ),# u# n4 C* o$ F! M% c7 c0 q) S
0 m7 C( x Y) [/ X V/ n |1 r4 X- I7 w( @* C: p4 z3 B" t
array( "name" => "125 x 125 Banners Advertisement Settings",7 c9 b0 z4 z" j* W1 u% k
"type" => "heading",; F* G% w7 u5 ^4 `! M2 b9 \# S
), \. \4 u1 H7 S) V) [! h3 b" ~( c: u
- ?% a) O* e% i7 }5 f' k9 w& f2 o
array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
# I2 Z! [8 m2 z6 ?$ u "id" => $shortname."_sponsor_activate",
' z5 c; ^! F8 B "type" => "select",2 n2 b; c" ^. k
"std" => "No",! o$ w" c; x5 s" T' W0 s
"options" => array("No", "Yes")),# Q( h: n$ H3 \& _; L- ?
, n7 p1 s$ Y% z- @' p* K
( W( E3 c! L0 A array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",
0 q$ q# X4 C. v "id" => $shortname."_sponsor_banner_one",
5 G7 g" p* S4 q# n6 C "type" => "textarea",9 h! @& g! d7 h' t1 E' R" s
"std" => "",
7 h) z8 ?0 a& `2 [. p# n7 g ), % v* T6 Q+ [- U! h# o2 E
: O/ [% e( E! e1 Y9 d3 w5 A
array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",
, ^* |4 m: K) t( A0 } "id" => $shortname."_sponsor_banner_two",
3 x: `, y! J7 J( x* c "type" => "textarea", S2 e0 d9 p- N3 [
"std" => "",0 ~- ?1 E G7 Z- w
),. k9 D5 q9 i, R% J3 b- q* D C0 T
: y. M6 V/ j _. W& a array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",
5 q. Y- \" D+ s9 f( I q "id" => $shortname."_sponsor_banner_three",, c* R/ ~" i: v. a8 y
"type" => "textarea",0 j) i8 @- K4 u4 S0 ~& r* g
"std" => "",1 [- i& ^$ }9 J" H
),/ {. x# Z* ?: F: Y
; @- @ P% j0 f# U: j8 T# }# I0 [2 W
array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",! s' P$ M& q2 w" N$ g& ^( }$ {
"id" => $shortname."_sponsor_banner_four",9 ` r* X6 y2 W6 ~! v! Q
"type" => "textarea",
: k8 J/ Y9 W. X: Y4 f+ _( o) @ } "std" => "",2 h" e# j, d4 g2 K% L- A
),
' ]6 _6 A3 L0 j( P0 H' E7 f9 E( @, S/ @7 t
array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",! i' ^/ u" M0 C
"id" => $shortname."_sponsor_banner_five",
" J& H* e2 [4 \! m7 S& z) i0 k "type" => "textarea",
$ x% Z5 E& i7 D3 x, M. } "std" => "",! @- {; y& P& h% V2 K: {
),4 e' @7 g5 `% B9 t$ _* m; [
0 u1 I4 a/ L1 J- c( j7 t# U. V
array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",
9 I+ M# w+ [) @, J- U4 K "id" => $shortname."_sponsor_banner_six",/ g( @8 Y- h: L- k) K! I+ [5 B
"type" => "textarea",
! h' Y2 h3 l+ a0 j/ K9 ~) @ "std" => "",5 |1 `) ?1 u! z9 G4 @
)," Z8 t4 t+ I/ D2 j& i
; s3 z' m6 x3 N7 y& G% W) p- \
array( "name" => "</div></div>",
! H0 Y$ r% K; V0 D "type" => "close",
, W f7 d: I1 y! U: G8 b: b ),
8 g4 A: {/ d. H( `1 b) s$ h- m
% c1 M* M0 a" n* Z, s9 f8 @5 q1 G( [6 s) d. r
; {: ^4 O1 }+ |);) a, L h# s$ H v0 O8 J5 o1 \
/ U: W8 ]9 |+ e
function mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {
' @( q& n( P: K& U" v5 E0 `8 @( i+ G" Y( h
echo "<div id=\"admin-options\"> ";8 P) ~; G! Y8 ~; N+ l. s/ p& f
0 `8 }+ w/ R7 b5 {( Z* b
global $themename, $shortname, $options;! Q% J* {1 W& L, a
if ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';
4 E7 M& @4 a, C( l% p3 y% @( rif ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';) d5 [" u3 i& M' {. J: X$ C! v
?>
7 b. g( d" y8 ` n$ p- h i& d( Q. l& d' G- ]- ?
<h4><?php echo "$themename"; ?> Theme Options</h4>' @4 a; u7 y8 x% y3 V$ w/ ?
- l: P5 {! P% A9 W* X<div class="annouce">' W& Y0 H- B: Q
<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1> d* y3 H' r4 q+ _" R/ U5 K' f- d
<p>Don't Forget to <a href="http://feedburner.google.com/fb/a/mailverify?uri=MagPress&loc=en_US" title="MagPress Newsletter" target="_blank" rel="nofollow"><b>Subscribe Our Free NewsLetter</b></a> In Order To Receive Theme's Updates and Fixes.</p>
, U: o2 R- ?- R% h</div>3 Z; ^! N' X. M) \
2 q6 N5 a3 _6 s6 I- K7 e<form action="" method="post">
$ b9 h1 A7 l( ?% g9 c+ n
9 f( N2 o6 U$ O8 l+ T<?php foreach ($options as $value) { ?>/ H# Q2 _( f( @
5 E% o. R6 x' l6 L4 w
<?php switch ( $value['type'] ) { case 'heading': ?>* S- g. \: W3 V2 t7 e
0 \8 B P: p$ Q6 `% ?' X& j1 a4 C
<div class="get-option">
- K0 b7 W L* u0 X, o7 T$ c/ n+ u8 M, u' B, U4 F
<h2><?php echo $value['name']; ?></h2>
5 X. x$ Z6 G: }7 r0 _ |! ~1 E: r8 R9 j1 g4 H4 i' ]
<div class="option-save">! \- r& F" H' n3 I1 c8 d5 E" a7 N
/ o3 v% s9 y7 q# U3 r y8 q J<?php
& V& e+ X# d6 a1 s/ Abreak;# Y9 R1 z6 o, ?$ u3 I0 w3 f- Z: m
case 'text':
( c! H, \+ h, {% M% K2 E?>
; j1 @9 a- H8 J$ l, h* V0 U; m. U6 V# Z. ]% J
<div class="description"><?php echo $value['name']; ?></div>. G# X" z# V- @# Y% ~* [
<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (
' _: G6 y! a5 S$ G4 a U* K5 }' `# v# Z& {: J# x$ ?/ v
get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>
, e! _8 E6 M+ i' @* B
8 X: q2 x; N4 k& w+ f<?php
4 v; N8 o1 _% j* kbreak;
5 t! i( w0 @3 o5 z4 t, pcase 'select':
5 Y8 ?" V; G3 J?>
" A) f* F. S0 ~+ ?8 H* o; n. ^. V2 Y! p6 V# H0 m
<div class="description"><?php echo $value['name']; ?></div>
9 p/ B( a- h9 |<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">
' y, `: W5 f! w3 p$ h<?php foreach ($value['options'] as $option) { ?>( k+ f X" U# h
<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>3 p0 D3 O3 {. C4 h
<?php } ?>8 F; p; K" h# p |/ B" ]
</select>
1 V3 U7 ]! f. F6 x. S</p>7 K: W# V; w2 M' |, X8 w
& O3 ~0 T; T' R2 f. Z1 x; K<?php! g3 z( K" }& k( A' q' T
break;0 w- V9 r+ l- }+ x
case 'textarea': D6 _6 r- {8 o/ |+ L' |: r' v
$valuex = $value['id'];. | q+ v y) l8 }
$valuey = stripslashes($valuex);6 X$ B1 N. E4 K! p
$video_code = get_settings($valuey);' t8 p; }) T" H9 y+ m( G8 A7 k2 ]
?>
8 i9 U- p- j1 r. L; O; U; d
0 A0 @; Z0 }5 Q! }: d R: A" C7 {, n<div class="description"><?php echo $value['name']; ?></div>
6 `' X. D) r. h<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }
$ b* J: ?3 w+ @' p( `, q, u o* Q& w4 H4 w$ f2 R
else { echo $value['std']; } ?></textarea></p>& l0 b# U% C* ?4 Q, [
# a% i+ o5 z+ w
<?php6 |5 K5 U( Q9 `/ }7 t' C& e
break;7 r$ V* w6 j1 `$ \9 ^2 F
case 'close':
7 v) ] f* T" ??>8 L" W& o7 M% j1 G3 i: s$ K5 `4 V
) [2 G+ E8 ]$ W3 [7 I<div class="clearfix"></div>, w9 o6 X* n7 i( U3 _/ v6 e
</div><!-- OPTION SAVE END -->3 l+ G9 h+ @: I! Z% B
7 P: }. ~2 B( t( V, o<div class="clearfix"></div>. I {* g4 N+ z8 V$ I& ^$ x4 s
</div><!-- GET OPTION END -->
9 q5 h7 F7 V& t1 J% x/ ~
3 m5 w) T' X5 a6 Z: o<?php- t' b* _$ o4 l) `& w3 u- ]
break;
. }7 Q! `) b+ W$ W! [. X8 N _& u" }default;! K1 Y- C7 i1 Q0 T# M+ K8 i
?>7 K& y, j- z9 |
3 c2 Q" Y+ L6 O5 G7 O8 T9 r. c3 {
4 e5 a4 U. y# N ?5 g. z! T' n
<?php
) j, Y( Y3 b, H B' Tbreak; } ?>, \7 `; G/ D f' L9 ~$ p: ]" S
6 T! \0 j, O3 Q$ ^
<?php } ?>/ F; ?# l0 J, N) M. P
% b! ?5 u# U# w/ ]& [<p class="save-p">
$ @1 `1 I/ H) U" X$ p, k<input name="save" type="submit" class="sbutton" value="Save Options" />
3 _5 K: v7 |" y" K1 E9 E<input type="hidden" name="action" value="save" />
2 W8 @+ T, D7 O, c, H7 [4 W</p>0 J! D5 g% p) \1 E/ J! x. ^
</form>5 I* S! \! H( C) ` e
' [# H5 z% Q8 I) ~0 O
<form method="post">+ X4 b: ?6 w+ J8 \1 r
<p class="save-p">
( o$ c: a: p) \5 `<input name="reset" type="submit" class="sbutton" value="Reset Options" />
9 F" c3 J8 h3 ^7 e/ _<input type="hidden" name="action" value="reset" />7 n0 @+ [6 W# @" g- y
</p>; f, o& P" w4 Y! F2 W, h+ z, O
</form>
# ~" X" V f7 M) W( Y2 c' _( d1 ~6 [9 H6 m0 Q. k/ r" A
</div><!-- ADMIN OPTIONS END -->
# _/ b& _: z9 E9 [1 {/ m k) N0 \0 Z$ p, m6 J5 {8 e( r* s+ ^- F
<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }
" w' F" h" o" A1 a4 M3 ]5 R3 l" R2 b. f* E3 _3 H+ F$ b4 R8 d3 a
function mytheme_admin_register() {- U* i, J* W# }$ {
global $themename, $shortname, $options;$ B& U6 c1 o$ J. y2 K# ]
if ( $_GET['page'] == basename(__FILE__) ) {* M0 {8 Z; ?" S* `
if ( 'save' == $_REQUEST['action'] ) {
5 J& c) y5 n' Xforeach ($options as $value) {6 ~0 z! b' t' ?3 ?9 W
update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }
+ m4 A9 N8 L1 Rforeach ($options as $value) {$ |6 y- D+ u7 Q2 ~ d/ ~# T( t
if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }
5 n( d" \, }5 k2 m: }$ I9 Theader("Location: themes.php?page=functions.php&saved=true");
1 i" k" ]& T3 W% ~die;8 ]/ }3 O+ z: E# o( s3 ?, @
} else if( 'reset' == $_REQUEST['action'] ) {1 k$ m7 \& L) s1 ^2 i1 M% `4 v
foreach ($options as $value) {% Y/ ?& S. O- L6 g8 H) q
delete_option( $value['id'] ); }
) \8 O, ?- k/ J$ m% jheader("Location: themes.php?page=functions.php&reset=true");
- g) p; t2 J4 W2 z7 ^, W, K( Ndie;
; C. ?5 g8 H+ F}7 H3 k7 l$ `. k& W1 x
}8 W7 W7 Z$ C7 H R/ M1 T- Z( h
add_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');& f0 d# M5 L V0 `- C( N
}
- y O9 I3 t2 a. T8 `6 Y
- L& G) [; W5 J3 w) F8 s5 tfunction mytheme_admin_head() { ?>1 J! E3 }& D8 g; ^
<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />; D- V! b7 \( u* J9 \: Y
<?php }; J" ~- t* M+ h/ A: v
|
|