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