|
|

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