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