|
|

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