|
|

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