|
|

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