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