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