|
|

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