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