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