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