|
|

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