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