|
|

楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////
& V8 e8 K! y' b9 w// Theme Option" y+ n8 V0 _# A' s+ p: s9 |
////////////////////////////////////////////////////////////////////////////////
$ Y* i( Y% c* J( t% C+ l# z! e& T, h/ F
$themename = "Zenx";9 S8 K5 b% D* D* G
$shortname = str_replace(' ', '_', strtolower($themename));
- w4 J' U, R" ^
+ q0 `8 \- |0 N$ D+ S7 Dfunction get_theme_option($option)
% V7 J9 V ]3 j{
: Z, A8 j( n/ }4 k6 }0 P- D/ o; E global $shortname;
% M+ C) m; I( K2 {/ F$ x0 I7 n return stripslashes(get_option($shortname . '_' . $option));
( O# G |9 x7 z1 k}5 k& o/ e4 Y+ ]/ k! Y# f
) d* f. ^" ~0 C8 K6 W' Efunction get_theme_settings($option)2 s+ B5 j5 @. l( r q4 S% T" @/ Z
{
& P' s$ D2 h- G ?' S! g+ E E return stripslashes(get_option($option));" j7 L4 W v, c: t {! \6 t
}
) H0 A$ ~8 ?7 w& K$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");( J- n8 S& o) o+ I6 s" z5 I
$wp_getcat = array();
. o' G: a$ C+ A! Q* Tforeach ($wp_dropdown_rd_admin as $category_list) {
5 z+ i5 `! n+ M# P0 p" Y$wp_getcat[$category_list->term_id] = $category_list->name;
! o0 M+ _& K' L9 @}
; \+ X7 K# @0 M2 g$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");
2 e2 s7 b. `% ~; P# u0 o$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");
0 {$ p4 Z, m6 X& T$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");
3 n, l% `- k8 ]) E% |$ p" {" F$ E
1 X1 p* l! Y, G, V5 S$options = array (; a" L% e% [1 p( z. n" Q: m
- }/ X6 Q; S6 i: X- q" }6 z! n' `: r3 T# }* e* k; G5 |
array( "name" => "Blog Header Settings",
4 c7 B/ S K9 H2 h& g "type" => "heading",
, e6 H9 Z+ E& @4 ^$ j* S5 u1 m ),7 A3 m* U9 }$ ]% X" i
) u2 w/ z) x4 x6 n2 g
array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",7 A. r1 Z) K6 U8 t" A& \+ h
"id" => $shortname."_header_logo_activate",
8 J1 e9 a& m; ~0 z0 [' G "type" => "select"," E/ [$ @9 s/ e* r$ k
"std" => "No"," h2 z. b2 z {" i8 A
"options" => array("No", "Yes")),
, L: a3 k7 Q& X
' H! G8 q" x# {1 Y5 R+ l array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",: c! F) U- `/ F7 {. i1 ?
"id" => $shortname."_logo_url",
; o% G L, S. a3 H+ D "type" => "text",6 s2 a* [: N* y0 K ^
"box" => "social",& X8 D$ Y* }. e
"std" => "",
! d. z. W- X! X* U ),# D8 | A0 i- D8 K
( [$ w- h" `/ n+ Z" d
array( "name" => "Insert Header Banner HTML Code (Header)
; }5 [* r; @+ G5 E2 h4 [ <br /><em>*Recommended Size 468 x 60</em>
% d3 F' q1 T, e& K <br /><em>*leave blank if not use</em>",5 _- y8 `. j7 d* K1 [/ \8 r
"id" => $shortname."_header_banner",
0 t6 j/ `- h* z4 c2 Z( W "type" => "textarea",
" o1 N' g8 _) M# i3 W/ a9 N "std" => "",
- @# | e( j. ^* j: v' i! W& G ),, h$ H& Z' d1 G( j, Q
$ @. Y7 |, c& ^3 F: h9 N array( "name" => "</div></div>",! S, \" n- V. y) k
"type" => "close",
! H# s5 N' V a; t7 Z) `' ^ ),
7 k6 n. U1 B5 D6 U! \3 o0 Y \7 U. C7 K& w
) j1 o" a* y4 n% u3 p array( "name" => "Header Navigation Settings",
w1 S. R, n% e" l* l" {, G "type" => "heading",
+ a* D* p' h9 }, F& J) |: s ),
7 n) i5 m7 m+ U; k( R9 x0 w2 o5 u) U8 i0 m+ x; j
array( "name" => "Insert Page ID To Exclude On Header Navigation<br />
4 R3 b8 V1 I: Q3 ~* z <em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />
5 ^+ U- t! [; z) d <em>*Enter the page post ID number only</em><br />" p& R. K+ X5 M! z" V6 ]
<em>*separate by comma</em><br />
4 b1 `- i% _" ]9 q" h/ P <em>*Exclude pages which you don't want to show on the header navigation</em>",, W# N8 l: ]3 p1 p; k& |6 z; N& [* D
"id" => $shortname."_header_page_navigation",
1 J( P2 p$ x" m. g/ z! d, m "type" => "text",
/ j3 J v/ k# n# ?/ U1 @ "std" => "",) v3 H4 @2 n7 C/ F M
),
8 {0 F0 f; I0 ]& h/ z
3 ^7 H" O5 Z9 l array( "name" => "</div></div>",# I1 }" j7 M1 Q: e% ]' \- [5 n' S# {
"type" => "close",* w: Z1 I, |- K+ K- g
),
' W; T* H3 n" z9 D# N& ^
, G% o. S7 ~+ W( a& s7 l2 G4 Z" x. a! p) r3 z+ [. O: L
array( "name" => "Post Auto Thumbnails Settings",
9 n$ y \- ^0 }% r "type" => "heading",
7 d' v( r( [! K+ \- x ),
1 i5 @% F/ ^: b" @ . \4 p& m& O; ?+ b- z# u! ?" p7 r
array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",; {4 b. l8 s- A5 v- i& y4 n5 Z0 R0 V" r
"id" => $shortname."_timthumb_activate",- D, }2 |7 k+ [9 Z
"type" => "select",) H+ g" F' U9 q2 I3 F
"std" => "No",
. G) j/ ~. O+ z8 `$ K "options" => array("No", "Yes")),
# _, m0 ^5 @3 W# Z" _6 { 5 M6 h6 x9 J/ ?( ~
array( "name" => "If Timthumb is enabled, Please choose its cropping method"," v9 c' |# Y/ @0 g0 h
"id" => $shortname."_timthumb_cropping",
0 w$ K5 |6 ~2 K# o7 l8 T7 T "type" => "select",* F# K1 `9 [0 T8 Y( i% l0 t
"std" => "",! E- u) W' I3 }* m
"options" => $crop_position),
. t4 Q Z/ b7 r) R7 `# D. R
" K+ D! h* o; H( U array( "name" => "Insert Width Of Thumbnail Image<br />
# R& Y$ R6 y- Y4 o5 ] <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />* [8 k- w1 i" Q7 Q% m3 m5 Q" H3 }
<em>*Leave Blank To Use Default: 250</em><br />",
+ T: c# j) w \( W" B0 ? "id" => $shortname."_thumb_width",1 m6 Z0 A- X( J0 z% e; o* k0 }
"type" => "text",
9 F- ^4 k7 G' Q0 \ "std" => "",
, {- ^5 D; H# w1 I& a- i ),
$ D4 M1 w( Y; E) u* N! y* m y. G( {3 \" Z
array( "name" => "Insert Height Of Thumbnail Image<br />: [% m% k( E+ D, N1 V
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />8 M; v! ~/ w$ Y) l( D; D J
<em>*Leave Blank To Use Default: 200</em><br />",
5 g) Y" r& W8 J "id" => $shortname."_thumb_height",4 D4 R" H" w% U8 X/ H: ?$ x$ q
"type" => "text",
1 V9 [9 y" g5 R! f* C: K "std" => "",
" e& y' W" r( ]8 L% g ),+ C5 c8 s6 m( i( D( y; r) }
( j7 j+ V- J0 [' X/ y- E
array( "name" => "</div></div>",2 q/ l5 T& r$ [6 N- m# D! ~
"type" => "close",& g4 o- v H0 I
),# {4 ^2 A2 A$ s, v ? t
4 ?+ ?$ U( f/ h1 n5 S# _+ B6 O1 u x) }
array( "name" => "Featured Content Slider Settings"," D# D5 W! s; L
"type" => "heading",5 v4 r& b) a D+ v- i* x" s, k
),
! C6 Y4 O3 f5 _2 g y" ]/ r" N
: q9 G+ h# I1 z0 X% z2 d7 E7 ^ array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",) d( w, w3 _) q6 z6 ]4 K
"id" => $shortname."_featured_activate",2 D+ X5 E3 @) m( M* O# A
"type" => "select",. X K7 L) I+ l d% @
"std" => "No",
3 W7 L$ G2 u1 o "options" => array("No", "Yes")),
0 Y% W+ l8 u* d/ O; D
; a" i6 i3 v8 ^4 h6 ]. l F! `3 ~- Z5 X' Y& D- }- P3 B
array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",* y( V$ v+ b% d- b2 K
"id" => $shortname."_featured_category",
8 ]8 W) r x" I7 l1 s$ t {0 J "type" => "select",
- z; ^( S6 Y# M* l1 I6 |3 ^% F8 t "std" => "Choose a category:",
A J$ [& _9 j- C "options" => $wp_getcat),, }+ o. N D4 {: J9 c( D1 M( t0 }
3 A- m: ~; b3 t1 G1 f
array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",
( I# f% K2 U! N! T4 M "id" => $shortname."_featured_number",2 M+ S1 P6 k1 t0 M/ N6 K1 ]( j, {0 I
"type" => "select",
, l+ s6 u& C) ` "std" => "Number of post:",
4 Z7 _$ w! N* J "options" => $number_entries),
- S7 K. p% s: u5 T, ]2 \
! `( r( o: Z9 ?8 n; ^4 F array( "name" => "</div></div>", P$ _9 _- a" ]
"type" => "close",
" u) |, C0 R9 u+ n, O7 ]# ^9 z ),, ?& i: G" }: Y; N; u
6 h8 x# a6 r" j
array( "name" => "Featured Category Settings",- z* g) X0 p1 [5 K; V, ?
"type" => "heading",6 C0 a3 i. M: N @" j; Q9 r
),& m8 z2 `, ~8 a0 ?: m/ N0 G
/ Q6 d) O# e- t7 D. F9 Z array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",. z$ B! F |- H f2 [2 @
"id" => $shortname."_featured_category_activate",
+ ^6 L9 ^9 A- U y3 A" s "type" => "select",
" i2 l4 i s; T% M, s/ Z "std" => "No",
* Q$ R& F$ ^% w e- U& c0 A2 J "options" => array("No", "Yes")),3 z* s; ]1 s! c- g
% |) l6 ?/ U, I- _. A; ^ U array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>"," E# M/ n6 f p0 N" ]6 U1 s
"id" => $shortname."_featured_category_id1",
4 g8 h5 {6 u- X' C/ z9 W# W "type" => "select",
( n! [, Q+ ^. m" @" p "std" => "Choose a category:",
1 P6 s2 N" ]8 {$ ~2 q "options" => $wp_getcat),5 Q7 W; T o. ^$ ]
+ j$ V+ V, e$ V. b: a array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",
n1 y$ A* i( e "id" => $shortname."_featured_number1",
; ~2 V# t, D: |2 R$ _ "type" => "select"," z6 b+ M+ {* z0 v% G
"std" => "Number of post:",& u4 O9 u8 Y+ Q5 f
"options" => $number_entries), s2 T! J7 D$ J% m' [& h, W# E
* Y1 V+ m+ X! A array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",! i( |$ H8 j1 f% h! ^$ h
"id" => $shortname."_featured_category_id2",
8 B/ @6 J- @+ W4 H "type" => "select",
9 C* ?. o5 A2 r. q7 ~4 q "std" => "Choose a category:",8 m5 t4 ?, C. T+ n6 P+ j
"options" => $wp_getcat),
* q5 o% s4 Q7 o+ [6 i 1 Y* z* h) \0 t5 W3 z' }
array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
( |5 M& r/ d% n; F Z "id" => $shortname."_featured_number2",
" K6 w% M) v; Z "type" => "select"," J: U; P# y* L# H i
"std" => "Number of post:",
% g) J/ W7 J' q# M6 ]# ^ "options" => $number_entries),$ |( Z' v. ?6 z0 T4 d! A
. ?* v; c8 b" H+ r* r g; f) W
v: N! l/ x `$ t$ y5 O ^+ {/ l5 k array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",; k9 K8 O$ g ?
"id" => $shortname."_featured_category_id3",& R9 F+ Y, I6 F" z2 K
"type" => "select",$ w8 } G- y4 F1 ]; J/ g/ x3 L
"std" => "Choose a category:",
7 \. n, ?; S& s* p. r "options" => $wp_getcat),
) J: `% F8 o2 i o X ! D* N3 }$ M8 y. h
array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
* ~' P" k3 {# I j "id" => $shortname."_featured_number3",
; o7 C+ P& ?; F" j! Y" K "type" => "select",4 Z3 W2 s& _8 |
"std" => "Number of post:",
H0 {* g* G* |, p# R, {# @! v "options" => $number_entries),9 v r9 x4 K# D8 r! F6 w6 K9 u! y
6 m) }3 [- v" `& @. a
% v- ?$ q1 n% v' H array( "name" => "</div></div>",; I5 U8 q9 F6 b& D! Y5 \
"type" => "close",) a% |/ }; ~+ N) J I1 h( N
),
0 P/ _% i6 A. @. |) q" ~3 U5 B5 B9 w; w2 {7 Y& a1 X
8 b6 t6 M- }+ y9 o
array( "name" => "Google Adsense & Analytics Settings",
9 S- P5 D4 ~. B |9 ~5 H "type" => "heading",
0 ~; W3 y2 h4 N7 X f1 A2 d ),' ]( f, K' k- P2 p9 a
\; \; D: H. ^* ~" ?7 z: _. k array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",
. I/ |% N' E( l# I' S! o "id" => $shortname."_adsense_loop_activate",
% s. E; T) s, V+ K8 Z1 ] "type" => "select",) _ {1 y; c2 `/ y: F
"std" => "Disable",* v/ W" m6 K* F% o3 C
"options" => array("Disable", "Enable")),
9 `& P6 ~* n, K7 j1 T
: @; ?0 J. [5 {& a. ` array( "name" => "Insert Google Adsense Code For Loops Here<br />
9 b6 {/ f) ?# a0 f- C6 c <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",: `7 h' t( p- z7 X) V8 H
"id" => $shortname."_adsense_loop",( ]6 z. s1 M. I% F% v9 Z% U
"type" => "textarea",
$ A3 G3 S$ T/ r7 K6 ^7 ~ "std" => "",- Z; s2 G( G6 {5 Z8 e; ]
),
" B$ U7 D) ~% D: q2 ?5 F) c8 N
0 Z6 [; R# d! ^5 p8 v. J( B; w array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",2 g* F1 @" {0 Z
"id" => $shortname."_adsense_single_activate",/ Y4 W% ]+ i1 d( ?) X
"type" => "select",1 t+ B, @9 }9 @: ~! T0 x4 C
"std" => "Disable",6 J& a8 \4 @9 [* f* a l% k
"options" => array("Disable", "Enable")),2 N& M& ^$ ` J4 N& ?& q" Q7 O
( ^4 \' [4 d) c$ t5 D2 f" u" Q9 D array( "name" => "Insert Google Adsense Code For Single Page Here<br />$ P$ v8 A/ d2 [, \1 x& h
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",- w+ h# I, K m( ]; l
"id" => $shortname."_adsense_single",, d- j+ H" q: p! l! ]5 G7 g
"type" => "textarea",
; Y' q- l N' U5 C- ~3 Z "std" => "",* ?7 l' }; G& g4 |1 w s- B' s
), W* v/ @: J1 [: q @ [5 z
+ [; W5 d* ?( P, N. j! a% C
2 v( S7 x. u) M+ c' @- H array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",8 u3 ]* I3 t8 E5 i
"id" => $shortname."_google_analytics",
# V+ b _. o6 L- h7 z+ E3 F9 A: v "type" => "textarea",
6 Z9 U" \: ?' m1 Q "std" => "",
0 _8 n$ O. D) n0 o! y ),; L5 L+ t' Y% K9 x9 ^2 x/ [& n4 l
" ~$ Q' _1 {' N* Z" ]% N, q array( "name" => "</div></div>",
5 R+ [ I# P5 O "type" => "close",5 W4 k3 M; t9 X f, Y
),
) a/ U& ^/ q2 A; L% y4 |5 j
; }3 H0 g/ Y' a, _
! J. A3 h( @+ g array( "name" => "AddThis Social Bookmarking Settings",. X% x2 s, c' z3 t5 B) ?, ]( f$ y
"type" => "heading",
8 K& l% J( E! }: @ ),
; r6 M3 L4 U8 I1 a1 C" I7 Z* V- o5 V& d& _/ K3 \1 i2 i
array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>
; p& T- L. Y& X# D$ c- {6 } <br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>"," A" r' f$ k% w- a; n8 q
"id" => $shortname."_addthis",
# ^ S/ H( ?$ ^! ?) p8 L3 k8 K "type" => "text",
9 `5 p1 }9 k K9 G3 ^; h0 L "box" => "social",
3 f* ?- \, k$ B" L, Z1 n0 J$ v. H% _ "std" => "",: i9 `) P$ x# e: A7 d/ d
),, r% h# k; o! ~' G
& l3 ?& t' C7 G. w
array( "name" => "</div></div>",0 b: n% I' V' j7 {5 ]
"type" => "close",% f1 K% I, E- h9 a' D! a
),' ]% ] P! y8 u; _8 k5 Y
2 H, k2 U* l7 k6 s g; p3 s, Y) S2 C
4 H. L- d3 |- W; W, O2 ?; V
; j8 ?' ]+ [! s3 [+ Q5 ~7 d3 N array( "name" => "YouTube Video Settings",1 J8 ]8 ?2 e1 K, s s" m: P% C' _
"type" => "heading",& P) T) ?/ A% Q/ p3 I: H
),
9 x) v4 K6 g* O5 g; C
( I( C2 \1 y+ j" L w- S! W array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
! i7 E/ F- z2 P: \6 t, m X "id" => $shortname."_emvideo_activate",
3 e- I2 ^3 \& p; A0 t+ y4 q "type" => "select",8 a3 ]3 A) Q' |/ k- ?5 w3 |
"std" => "No",' m. {) I& t8 T2 @' g+ p
"options" => array("No", "Yes")),8 D. g7 w: v0 h$ m$ P" `
/ n8 E/ o' n6 |: D8 w6 [; x 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>",
. |) W; Y8 ]% O4 A' l "id" => $shortname."_emvideo",# p( h2 h8 E! _ ~4 T i8 j! a! d8 u( l# M
"std" => "",
& N# {: Y5 n, {0 ]5 w "type" => "text"),
! V& M) T: X0 L1 _& F. u! M! E' z' y/ o6 p
array( "name" => "</div></div>",
. h& [) g0 j8 j6 s' M7 [; W "type" => "close",5 [# ?3 z9 ?" m) M
),; `" X- s7 J2 c) w4 }1 b5 D
! X! C, P5 f" K @8 I
array( "name" => "Twitter Settings",
+ s6 h# \$ b N "type" => "heading",
6 W- m9 h0 Q, p* g$ T$ b ),
O2 ^5 K7 L3 F0 ~5 ]; t6 U4 Z3 T5 _# {/ ]0 T
array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
2 F- G- E+ j' Y E: v8 N+ t, ]9 P8 m "id" => $shortname."_twitter_activate",
# F7 e) |( P+ k/ n1 I o "type" => "select",
" H) F- r7 _8 G/ @% e- `) H' | "std" => "No",
4 }; h7 _3 t0 [5 s1 P3 ] "options" => array("No", "Yes")),
( L9 y: V& ?8 c* T& Q! m! c
7 @( C9 S. m3 C array( "name" => "Insert Your Twitter ID here
6 e Y' j M/ e3 B <br /><em>*leave blank if not necessary</em> j: `( A9 V7 S2 R D' i% t
<br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",9 g1 \8 W: t' t: `$ _. m5 p" I
"id" => $shortname."_twitter",0 o' ]7 r, z$ s7 L
"type" => "text",
0 B" W' e+ r: I* S "box" => "social",3 A- `0 k& S5 l7 g
"std" => "",
1 M* `4 m, T9 ]" i )," x2 f) J9 x! R
! @, f+ T7 m* @7 x- B6 J" E array( "name" => "Enter Twitter Feed Count here/ U) N5 D- t, s) E- ^
<br /><em>*leave blank if not necessary</em>
2 q( y; J$ N q& m& o7 s |( N, B: H <br /><em>*Enter How Many Twitter Feed To Display</em>",
& J8 k% k c6 D9 z( J/ c2 @ "id" => $shortname."_twitter_count",
) F& T2 W- l* |" i3 Q. a4 } "type" => "text",: u6 j4 g& o5 i) P' w
"box" => "social",
! w0 ?! m. n8 ]: c% F% y "std" => "",
% n z$ G! Y2 ^% Y3 | ),0 P( [/ B- s T, D( W9 O
/ y4 V5 m: Z" A& I2 l array( "name" => "</div></div>",, u; o% t* F( K4 t5 f
"type" => "close",* J$ f1 J# w- k# [, m# j/ G
),, f+ X9 I4 t8 u# f: ^
4 x# D4 j% J- k7 I4 h
: h& [* T( U7 i, l( B
array( "name" => "125 x 125 Banners Advertisement Settings",+ q3 z; x7 l- n* g% e/ h
"type" => "heading",0 l8 c- C1 S4 G2 m
),
- F2 b( l$ B2 ^! O5 _( ~; O& |6 h4 H( u3 V
0 a9 ^ r7 T) _ h1 p array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>"," n4 [$ N1 _9 F) N6 y& c Y2 S
"id" => $shortname."_sponsor_activate",
5 g* p6 W* O* W1 F! l& E "type" => "select",4 l n; x. g& _- H R& t
"std" => "No",0 R# w. v3 E$ V9 h% ~$ q7 y
"options" => array("No", "Yes")),
- l1 r8 }* F! h' a ?1 T
$ ~/ E, X3 ^" g6 u: U
3 }6 _& u2 o, \, f% k. F* r1 P& c array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",
; P* C5 W, N& R) ]! {) V8 X "id" => $shortname."_sponsor_banner_one",2 Y8 L) B* t4 b9 P& J
"type" => "textarea",1 @) S8 f2 o ?2 X9 ~
"std" => "",/ \/ T, Y) u8 K, ]6 W8 T! E# Y' Z
), # ~. ^6 N, y; a9 j
1 y, Z- y: W3 b6 b7 M array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",$ ^7 {. i) U' \0 {9 a# j
"id" => $shortname."_sponsor_banner_two",6 g+ j3 T1 P$ Y% K; @; t7 M
"type" => "textarea",
) e7 g" f; I+ N. W "std" => "",
" `! u! \9 g% Z' p, U, v ),0 @" S9 q% R3 ?3 f/ a8 N
9 ]& l1 J2 |6 w, y; D. O% p
array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",8 _9 V/ I) i7 w, U" N
"id" => $shortname."_sponsor_banner_three",
e# J( P* E l& V2 P+ G "type" => "textarea",
- @. A" X2 ?! D; x. {0 U: r2 y6 k "std" => "",
" i7 j$ T$ t5 H( ~5 E ),
6 h1 h- K! V* I) `5 `% h) S
1 I/ p2 Y$ r# \& o: M3 z! @9 Z x array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",* q$ b; ]) {7 b% i+ T5 D
"id" => $shortname."_sponsor_banner_four",' I- e7 l3 l' k( ?
"type" => "textarea",0 d8 v" B/ E1 n6 B
"std" => "",
9 L. ]/ _ @! R$ P7 O( g ),
2 f/ r# \& L* Y3 V' m4 W
: \" q1 R0 m) z# n6 k4 U array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",. C4 K4 u3 y8 b$ I+ d7 G5 Q
"id" => $shortname."_sponsor_banner_five",
: H3 b; k% a1 z1 K. |2 ? "type" => "textarea",
4 k! r x3 i# O "std" => "",5 g: ^! A7 Q( Y1 f- l
),: o. p4 B, o+ l# T! t
1 z! f9 x9 M) H% o+ J& E4 L1 h
array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",' e; _" s1 B: g; F2 E
"id" => $shortname."_sponsor_banner_six",3 V1 X1 \- ]5 t L
"type" => "textarea",
3 r5 a' p! P8 \' Q+ f "std" => "",
$ s9 x* e# E7 F# A' k/ H9 z, b2 S2 n ),6 ^0 f' p; Z+ R
0 Q# H( A: J1 {
array( "name" => "</div></div>",
, [8 r* m. _0 T6 B* B) o6 z "type" => "close",7 K( S$ G/ X) i/ {& `9 Y* ]7 e
),8 o* [; a @4 ~: }& X5 E/ H
2 S# J7 O( @" p8 D% ~
4 g2 ^/ |5 u& B2 S- X, c3 a+ L, ] I" h
);
7 h0 L; x4 E F& b& h2 {
* ?& {, A; @7 e0 U: P' ^function mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {
h* s! M: I( d* c
3 I4 F2 o7 }; k9 w* B% q8 P! A" ?3 uecho "<div id=\"admin-options\"> ";
) O2 F9 R2 Z% c) n- T8 {" G! Y( n3 v) Z% _! z. I
global $themename, $shortname, $options;+ a( |; k c! C( z6 Z4 ^1 [9 ^
if ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';
' y9 D' i8 y, r1 pif ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';4 K7 d" m; G* d7 \! ^+ S
?>
1 \( d* \. k6 u z& P" Z$ s* Y$ @4 G9 `( G6 o
<h4><?php echo "$themename"; ?> Theme Options</h4>
- v0 @; P5 H" f7 ?7 ^+ ?3 M4 r! [7 }- M1 u4 h, C0 q
<div class="annouce">
* U4 ^! g" c6 V# u' T9 {<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>
2 Z6 e9 [) Y5 V$ {<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>6 _) j7 H) n O: @% O/ Y7 _8 j
</div>
3 ]5 w$ d$ j2 D' W8 K, o! C' [
* E$ Y; k% g" Y u<form action="" method="post">8 b5 l& Y9 L+ k) P& |2 X2 ^
$ t v5 \8 K( s1 H, Y2 i2 q6 Z
<?php foreach ($options as $value) { ?>
: z6 f7 H% i; U6 q" n. f- z- A! h) X) ^1 a8 q
<?php switch ( $value['type'] ) { case 'heading': ?>
' k, Z' H& r1 H# R( N6 c" Y( K ~$ n* j4 |) i0 O
<div class="get-option">
: Z0 N2 N! _' |/ f3 ~$ q7 N1 k4 O: {; D
<h2><?php echo $value['name']; ?></h2>% r$ I3 v7 P F1 l( n
# ^- z5 A+ M; \
<div class="option-save">
& J! x4 c6 G& X9 a: ]7 t4 p0 N7 ?- T0 p7 H6 d
<?php
1 k6 W2 `- p7 w& U$ K- o; Ebreak;0 I3 {% Y0 ]$ x
case 'text':
( S* |5 R2 Z5 C$ A& h?># p- w; q* f; H8 Q3 k6 I
4 F1 `$ \* _- M: w6 l<div class="description"><?php echo $value['name']; ?></div>, u' [ r# L5 Z: b0 O2 Y5 U
<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (
, Y+ i- I! Y4 ^0 h0 s" C" X' a7 S
) H1 n* b0 H6 R8 w8 F: w5 ^get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>
5 j& B4 I: I, r, z
* n1 `; X0 }; R$ K0 f- W9 b* l' f<?php
0 }4 ~2 @* J1 ^. b8 `9 K! e# Nbreak;
1 C- z# _& v+ Tcase 'select':
6 l7 t! r9 z' Z; _6 q& Q7 b?>/ j. q& y0 `+ o5 S3 g; k/ @5 V
* Z7 r$ w6 P1 c% S0 [* d# c& R- m
<div class="description"><?php echo $value['name']; ?></div>
4 V. V5 P) F/ Q- b$ H<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">
5 @7 G- N2 h& N+ ~ s: K<?php foreach ($value['options'] as $option) { ?>
: y6 \4 u7 F3 p- P0 h<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>! \. ^2 f8 g. }! h
<?php } ?> v" h7 V1 T) ^ @ [! J+ `
</select># j3 R: m: O& R9 O; U) v- ^
</p>5 Y. d) h( R7 a* O+ `. m
" \" T( [5 U, U4 h3 c- f<?php
6 ^1 k- C" ^2 bbreak;
- e; M$ j; d9 n l% d* Ycase 'textarea':" u- d$ ]. A4 I- R
$valuex = $value['id'];) Y: \ U, @ P5 u F
$valuey = stripslashes($valuex);
' I' z* A/ H( I0 A8 c- C* Z$video_code = get_settings($valuey);
3 T; }' y. Q' ^' u3 t?>$ v! N# {" x e* x; K
# m/ _$ f8 I! e1 |; m5 \' l
<div class="description"><?php echo $value['name']; ?></div>- q: K: y6 D6 [) {* K3 t. s
<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }/ E" L5 r' W) ?0 L9 e5 i
& H g3 u! ~1 W7 _, _% _/ v4 P) j
else { echo $value['std']; } ?></textarea></p>
6 e* | Z' b8 ~* ?- c7 G1 D7 S+ F y0 L0 M4 a# I- {4 @4 f
<?php
' c7 j) h' s7 P$ [8 c# pbreak;* H1 O2 p, V* _8 V6 v/ O7 F
case 'close':$ n& f1 m$ V! `2 }/ f$ U
?>- K/ `% k, c! y9 R9 v: S
& L7 g: f1 {. h% I0 P1 h; z+ E; i: R<div class="clearfix"></div>
- T4 V, t+ s: \! u6 Q</div><!-- OPTION SAVE END -->
3 X" x" _: a P- f, b V( a1 V4 H2 r* q' t7 |: s1 A7 F7 q$ E
<div class="clearfix"></div>6 r6 s+ c0 @% C' |5 `0 [% G
</div><!-- GET OPTION END -->* S7 ?2 ?* c: t' p& V* D9 @
. k& ~ M) ]5 q8 L" S; E, l<?php
- w* M1 S6 O6 G( I, @) {1 ]+ ]9 qbreak;& W2 Q0 i: a& ?8 x
default;2 L2 [% B4 ~" K; Z4 x! a) E l
?>+ W( N; E, T- q( d. a$ K; b
: l) L; V$ a0 J8 ~( W n
) _3 N2 q9 X; n) S1 G: N0 ?" j<?php
3 M" ]% b; D$ tbreak; } ?>
& N7 l+ M4 }- ?/ e% i: }+ a. _! z
- @- a+ K' ]3 G. N<?php } ?>, q6 i) E" o( i, U
: F. m9 n2 f$ c1 R8 Z( D<p class="save-p">7 d3 c% t2 y+ G. t4 I
<input name="save" type="submit" class="sbutton" value="Save Options" />5 x. W2 U# S- f& u% m* x
<input type="hidden" name="action" value="save" />
* J2 ~! d$ y' R+ d% n& T9 I4 w$ a</p>3 ~0 f: X ~1 V$ p' P0 r, z1 v+ i
</form>2 x1 l/ h6 M K0 z7 N- M
' O' i$ o* W4 x, |<form method="post">
: q$ f6 P* V* O4 ]' J+ B& H. K7 F<p class="save-p">6 z+ k7 n& i6 i$ r! s6 q
<input name="reset" type="submit" class="sbutton" value="Reset Options" />
, [1 k# z2 t0 ^! h8 |$ }9 W<input type="hidden" name="action" value="reset" />( @) ^( ]- F5 q" a
</p>( q& L$ d; c4 `4 A; i
</form>
, I8 {- h, O/ R- H" h% s3 @9 S# _( p& s2 n( K
</div><!-- ADMIN OPTIONS END -->
M: H% K6 c3 F- [* d8 n" O+ B* d6 a% l& z: a5 q
<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }% }# B4 l- b& N
- |& G; @$ }; c7 @$ P+ qfunction mytheme_admin_register() {
0 F' @ ?* X& b8 E& e5 rglobal $themename, $shortname, $options;
9 J1 L8 W4 P. W5 C+ X5 d' Fif ( $_GET['page'] == basename(__FILE__) ) {
0 j' ?( p* w9 x ~! J3 w% Cif ( 'save' == $_REQUEST['action'] ) {
, b! ~% j: v% Wforeach ($options as $value) {' a3 k1 g; _% Z+ t* G4 V X
update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }
- T" ]7 ^ _; g# m/ N* B9 G! O, ~ Cforeach ($options as $value) {2 R1 Z( B. p' r8 k' J
if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }. O% R. t( c8 E, e- p; E
header("Location: themes.php?page=functions.php&saved=true");
& ?5 e& ?9 J6 J/ ^! h) ^die;
+ {& t; Z [, M. \, K% \} else if( 'reset' == $_REQUEST['action'] ) {( E8 ]+ y& U) B0 S
foreach ($options as $value) {8 P3 B( M7 q" w; L
delete_option( $value['id'] ); }
2 a, b% J) ~ c; C+ R- theader("Location: themes.php?page=functions.php&reset=true");
$ o- y) @8 d$ @; E8 c2 Ldie;
; S x5 \, b2 |7 m4 i6 k7 W}
) p7 o5 `' a9 a}
+ Z* Y& ^# R# @1 Z/ G7 B2 Vadd_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');9 F% \8 j+ n5 `" t) ?* I+ a/ @ P; N
}
; d9 W1 k' p& |9 T* f2 E/ x6 i" o2 T* Q( ^2 U
function mytheme_admin_head() { ?>
* k/ h( W) V8 E; b<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />
* _: _: ]5 y; j# D5 t. b `<?php }* ~* ?! O9 h" U. M, X
|
|